37 lines
824 B
Makefile
37 lines
824 B
Makefile
.PHONY: self-update create-contexts deploy upload pull start stop restart
|
|
|
|
include make-deploy/docker.mk
|
|
include config.mk
|
|
|
|
self-update:
|
|
@- git submodule update --remote
|
|
|
|
create-contexts:
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \
|
|
)
|
|
|
|
deploy: upload pre-deploy pull start post-deploy
|
|
|
|
pre-deploy: pre-deploy-$(DEPLOY_TYPE)
|
|
|
|
post-deploy: post-deploy-$(DEPLOY_TYPE)
|
|
|
|
upload:
|
|
@- echo "\n### uploading files"
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
rsync -rav --exclude '*~' --exclude '.git*' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
|
|
)
|
|
|
|
pull: pull-$(DEPLOY_TYPE)
|
|
|
|
start: start-$(DEPLOY_TYPE)
|
|
|
|
stop: stop-$(DEPLOY_TYPE)
|
|
|
|
logs: logs-$(DEPLOY_TYPE)
|
|
|
|
restart: restart-$(DEPLOY_TYPE)
|
|
|
|
reload: reload-$(DEPLOY_TYPE)
|