swarm stuff

This commit is contained in:
Andreas Neue 2022-07-04 23:33:58 +02:00
parent 64f447bbe9
commit b0cb40c08f
1 changed files with 19 additions and 6 deletions

View File

@ -42,13 +42,17 @@ upload:
rsync -rav --exclude '*~' --exclude '.git*' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
)
pull:
pull: pull-$(DEPLOY_TYPE)
pull-compose:
@- echo "\n### pulling image(s)"
@- $(foreach ctx,$(DEPLOY_HOSTS), \
docker context use $(ctx); \
docker pull $(DOCKER_IMAGE); \
)
pull-swarm:
start: start-$(DEPLOY_TYPE)
start-compose:
@ -59,7 +63,11 @@ start-compose:
)
start-swarm:
@- echo "\n### starting service(s)"
@- $(foreach ctx,$(DEPLOY_HOSTS), \
docker stack deploy -c $(DEPLOY_PATH)/$(DEPLOY_NAME)/stack.yml $(DEPLOY_NAME); \
)
stop: stop-$(DEPLOY_TYPE)
stop-compose:
@ -70,7 +78,11 @@ stop-compose:
)
stop-swarm:
@- echo "\n### stopping service(s)"
@- $(foreach ctx,$(DEPLOY_HOSTS), \
docker stack rm $(DEPLOY_NAME); \
)
logs: logs-$(DEPLOY_TYPE)
logs-compose:
@ -78,9 +90,10 @@ logs-compose:
@- docker context use $(host)
@- docker-compose logs -f $(service)
logs-swarm:
@- echo "\n### logs"
@- docker service logs -f $(service)
restart: restart-$(DEPLOY_TYPE)
restart-compose: