make-deploy/swarm.mk

25 lines
582 B
Makefile

MANDATORY-swarm = DEPLOY_HOSTS DEPLOY_TYPE TAG
pull-swarm:
start-swarm:
@- echo "\n### starting service(s)"
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker stack deploy -c stack.yml $(DEPLOY_NAME)"; \
)
stop-swarm:
@- echo "\n### stopping service(s)"
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \
ssh $(SSH_USER)@$(host) "docker stack rm $(DEPLOY_NAME)"; \
)
logs-swarm:
@- echo "\n### logs"
@- ssh $(SSH_USER)@$(host) "docker service logs -f $(service)"
restart-swarm:
# nop