Makefile 873 B

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