2023-04-27 07:01:39 +00:00
|
|
|
MANDATORY-compose-file = DEPLOY_HOSTS DEPLOY_TYPE TAG DEPLOY_COMPOSE_FILE DEPLOY_COMPOSE_PROJECT
|
2023-04-27 06:15:51 +00:00
|
|
|
|
2023-04-27 07:01:39 +00:00
|
|
|
pull-compose-file:
|
2023-04-27 06:15:51 +00:00
|
|
|
@- echo "\n### pulling image(s)"
|
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
|
|
echo "$(host)"; \
|
|
|
|
if test $(DOCKER_LOGIN) -eq 1 ; \
|
|
|
|
then \
|
|
|
|
ssh $(SSH_USER)@$(host) "docker login -u $(DOCKER_USER) -p $(DOCKER_PASS) $(DOCKER_REGISTRY)"; \
|
|
|
|
fi; \
|
|
|
|
ssh $(SSH_USER)@$(host) "docker pull $(DOCKER_IMAGE)"; \
|
|
|
|
)
|
|
|
|
|
2023-04-27 07:01:39 +00:00
|
|
|
start-compose-file:
|
2023-04-27 06:15:51 +00:00
|
|
|
@- echo "\n### starting service(s)"
|
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
|
|
echo "$(host)"; \
|
|
|
|
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) up -d"; \
|
|
|
|
)
|
|
|
|
|
2023-04-27 07:01:39 +00:00
|
|
|
stop-compose-file:
|
2023-04-27 06:15:51 +00:00
|
|
|
@- echo "\n### stopping service(s)"
|
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
|
|
echo "$(host)"; \
|
|
|
|
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) down"; \
|
|
|
|
)
|
|
|
|
|
2023-04-27 07:01:39 +00:00
|
|
|
logs-compose-file:
|
2023-04-27 06:15:51 +00:00
|
|
|
@- echo "\n### logs"
|
|
|
|
@- ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) logs -f $(service)"
|
|
|
|
|
2023-04-27 07:01:39 +00:00
|
|
|
restart-compose-file:
|
2023-04-27 06:15:51 +00:00
|
|
|
@- $(foreach host,$(DEPLOY_HOSTS), \
|
|
|
|
echo "$(host)"; \
|
|
|
|
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) restart"; \
|
|
|
|
)
|