Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. DOCKER_IMAGE_NAME=observe-ui
  2. DOCKER_REMOTE_IMAGE_NAME=reg.cestong.com.cn/cecf/${DOCKER_IMAGE_NAME}
  3. # DOCKER_REMOTE_IMAGE_NAME=pujielan/${DOCKER_IMAGE_NAME}
  4. docker-build:
  5. npm run build
  6. git rev-parse --short HEAD > dist/version
  7. docker build . -t ${DOCKER_IMAGE_NAME}
  8. docker-push: docker-build
  9. docker tag ${DOCKER_IMAGE_NAME} ${DOCKER_REMOTE_IMAGE_NAME}
  10. docker push ${DOCKER_REMOTE_IMAGE_NAME}
  11. deploy: docker-push
  12. ssh km1 'kubectl rollout restart deployment obui -n observe'
  13. docker-build-php:
  14. docker build -t registry.cestong.com:8150/zhixueyun/hx-php-server -f ./deploy/php/Dockerfile .
  15. docker-push-php: docker-build-php
  16. docker push registry.cestong.com:8150/zhixueyun/hx-php-server
  17. docker-build-nginx:
  18. docker build -t registry.cestong.com:8150/zhixueyun/hx-nginx -f ./deploy/nginx/Dockerfile .
  19. db-backup-file = ~/data/test_ctc_backup_$(shell date '+%Y-%m-%dT%H-%M').sql
  20. db-backup-test:
  21. ssh cest-2 'cd data && mysqldump -h 172.17.172.137 -u root -p1qaz2wsx3edc -P 53306 --databases ctc > dump.sql'
  22. scp cest-2:~/data/dump.sql ${db-backup-file}
  23. db-sync-to-local: db-backup-test
  24. mysql -u root -p1234 -h 127.0.0.1 < ${db-backup-file}
  25. release-tag:
  26. git tag "v${VERSION}"
  27. git push --tags
  28. ob-pack:
  29. git rev-parse --short HEAD > version
  30. docker build -f buildDockerfile . -t ${DOCKER_IMAGE_NAME}
  31. ob-push: ob-pack
  32. docker tag ${DOCKER_IMAGE_NAME} ${DOCKER_REMOTE_IMAGE_NAME}
  33. docker push ${DOCKER_REMOTE_IMAGE_NAME}