25 lines
596 B
Makefile
25 lines
596 B
Makefile
MANDATORY = DEPLOY_PATH DEPLOY_NAME DEPLOY_HOSTS DEPLOY_TYPE
|
|
|
|
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
|