2022-07-05 06:27:23 +00:00
|
|
|
.PHONY: self-update create-contexts deploy upload pull start stop restart
|
2022-07-03 21:06:54 +00:00
|
|
|
|
2022-07-05 06:27:23 +00:00
|
|
|
include make-deploy/docker.mk
|
2022-07-03 21:06:54 +00:00
|
|
|
include config.mk
|
|
|
|
|
2022-07-04 15:43:57 +00:00
|
|
|
self-update:
|
|
|
|
@- git submodule update --remote
|
|
|
|
|
2022-07-04 07:47:18 +00:00
|
|
|
create-contexts:
|
2022-07-03 21:06:54 +00:00
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
|
|
docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \
|
|
|
|
)
|
|
|
|
|
|
|
|
deploy: upload pre-deploy pull start post-deploy
|
|
|
|
|
2022-07-04 07:47:18 +00:00
|
|
|
pre-deploy: pre-deploy-$(DEPLOY_TYPE)
|
|
|
|
|
2022-07-04 10:43:51 +00:00
|
|
|
post-deploy: post-deploy-$(DEPLOY_TYPE)
|
2022-07-04 07:47:18 +00:00
|
|
|
|
2022-07-03 21:06:54 +00:00
|
|
|
upload:
|
|
|
|
@- echo "\n### uploading files"
|
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
2022-07-04 15:47:31 +00:00
|
|
|
rsync -rav --exclude '*~' --exclude '.git*' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
|
2022-07-03 21:06:54 +00:00
|
|
|
)
|
|
|
|
|
2022-07-04 21:33:58 +00:00
|
|
|
pull: pull-$(DEPLOY_TYPE)
|
|
|
|
|
2022-07-03 21:06:54 +00:00
|
|
|
start: start-$(DEPLOY_TYPE)
|
|
|
|
|
2022-07-04 07:47:18 +00:00
|
|
|
stop: stop-$(DEPLOY_TYPE)
|
|
|
|
|
|
|
|
logs: logs-$(DEPLOY_TYPE)
|
2022-07-03 21:06:54 +00:00
|
|
|
|
2022-07-04 07:47:18 +00:00
|
|
|
restart: restart-$(DEPLOY_TYPE)
|
|
|
|
|
|
|
|
reload: reload-$(DEPLOY_TYPE)
|