Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. NAME=datax-admin
  2. VERSION=latest
  3. BUILD_TIME := $(shell date "+%F %T")
  4. COMMIT_SHA1 := $(shell git rev-parse HEAD)
  5. AUTHOR := $(shell git show -s --format='%an')
  6. REMOTE_WORKSPACE=/home/sxkj/liweiquan/datax-admin
  7. USER=sxkj
  8. HOST=192.168.199.110
  9. .PHONY: image publish
  10. all: image publish
  11. image:
  12. @docker build --target image-dev -t registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):$(VERSION) .
  13. publish:
  14. @docker push registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):$(VERSION)
  15. pull:
  16. @docker pull registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):$(VERSION)
  17. deploy: image
  18. @docker-compose down && docker-compose up -d
  19. remote:
  20. @ssh -t $(USER)@$(HOST) "cd $(REMOTE_WORKSPACE); make deploy"
  21. idctest:
  22. @docker build --target image-idctest -t registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):idctest .
  23. @docker push registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):idctest
  24. sxkj:
  25. @docker build --target image-sxkj -t SXKJ:32775/$(NAME):sxkj .
  26. @docker push SXKJ:32775/$(NAME):sxkj
  27. txtest:
  28. @docker build --target image-test -t registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):txtest .
  29. @docker push registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):txtest
  30. txprod:
  31. @docker build --target image-txprod -t registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):txprod .
  32. @docker push registry.cn-hangzhou.aliyuncs.com/sxtest/$(NAME):txprod
  33. rsync:
  34. @rsync -azP --exclude ".*/" --exclude "tmp/" `pwd` sxkj@192.168.199.109:/home/sxkj/zhangli/