simplified module loading

This commit is contained in:
Andreas Neue 2023-01-04 12:26:52 +01:00
parent 7e4afb11b1
commit 0bdd5fa243
3 changed files with 25 additions and 30 deletions

View File

@ -1,12 +1,7 @@
-include secrets.mk -include secrets.mk
include config.mk include config.mk
-include $(DEPLOY_CONFIG_OVERRIDE) -include $(DEPLOY_CONFIG_OVERRIDE)
include make-deploy/copy.mk include make-deploy/$(DEPLOY_TYPE).mk
include make-deploy/docker.mk
include make-deploy/k8s.mk
include make-deploy/cron.mk
include make-deploy/kustomize.mk
include make-deploy/helm.mk
.PHONY: self-update mandatory prerequisites prepare build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload .PHONY: self-update mandatory prerequisites prepare build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload

View File

@ -1,5 +1,4 @@
MANDATORY-compose = DEPLOY_HOSTS DEPLOY_TYPE TAG MANDATORY-compose = DEPLOY_HOSTS DEPLOY_TYPE TAG
MANDATORY-swarm = DEPLOY_HOSTS DEPLOY_TYPE TAG
pull-compose: pull-compose:
@- echo "\n### pulling image(s)" @- echo "\n### pulling image(s)"
@ -12,8 +11,6 @@ pull-compose:
ssh $(SSH_USER)@$(host) "docker pull $(DOCKER_IMAGE)"; \ ssh $(SSH_USER)@$(host) "docker pull $(DOCKER_IMAGE)"; \
) )
pull-swarm:
start-compose: start-compose:
@- echo "\n### starting service(s)" @- echo "\n### starting service(s)"
@- $(foreach host,$(DEPLOY_HOSTS), \ @- $(foreach host,$(DEPLOY_HOSTS), \
@ -21,13 +18,6 @@ start-compose:
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose up -d"; \ ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose up -d"; \
) )
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-compose: stop-compose:
@- echo "\n### stopping service(s)" @- echo "\n### stopping service(s)"
@- $(foreach host,$(DEPLOY_HOSTS), \ @- $(foreach host,$(DEPLOY_HOSTS), \
@ -35,26 +25,12 @@ stop-compose:
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose down"; \ ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose down"; \
) )
stop-swarm:
@- echo "\n### stopping service(s)"
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \
ssh $(SSH_USER)@$(host) "docker stack rm $(DEPLOY_NAME)"; \
)
logs-compose: logs-compose:
@- echo "\n### logs" @- echo "\n### logs"
@- ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose logs -f $(service)" @- ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose logs -f $(service)"
logs-swarm:
@- echo "\n### logs"
@- ssh $(SSH_USER)@$(host) "docker service logs -f $(service)"
restart-compose: restart-compose:
@- $(foreach host,$(DEPLOY_HOSTS), \ @- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \ echo "$(host)"; \
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose restart"; \ ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose restart"; \
) )
restart-swarm:
# nop

24
swarm.mk Normal file
View File

@ -0,0 +1,24 @@
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