Makefile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. clientPath = './'
  2. serverPath = './server/'
  3. targetPath = '/srv/www/simple-calorie-tracker'
  4. host = 'mightyserver'
  5. all: build
  6. setup:
  7. npm i --prefix ${clientPath}
  8. npm i --prefix ${serverPath}
  9. build:
  10. npm run build --prefix ${clientPath}
  11. ensure-target-directories:
  12. ssh ${host} mkdir -p ${targetPath}/
  13. deploy-server: ensure-target-directories
  14. rsync -vzruc --delete-before -e ssh ./{dist,nginx} ${host}:${targetPath}/
  15. ssh ${host} mkdir -p ${targetPath}/log
  16. build-and-deploy: build deploy-server
  17. prepare-docker-compose:
  18. rsync -vzruc --delete-before -e ssh ./docker-compose.yml ${host}:${targetPath}/
  19. stop-server:
  20. ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down
  21. start-server: prepare-docker-compose
  22. ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml up -d --build
  23. restart-server: stop-server deploy-server start-server
  24. stop-and-clean:
  25. ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down --rmi local --remove-orphans -v
  26. redeploy: stop-and-clean deploy-server start-server