From c6683de2b33cb9550d0675896d040bc6592311b3 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Tue, 20 Sep 2022 13:13:37 +0200 Subject: [PATCH] docker login if needed --- docker.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker.mk b/docker.mk index 4cfddb6..149d6f3 100644 --- a/docker.mk +++ b/docker.mk @@ -7,7 +7,7 @@ create-docker-contexts: @- $(foreach host,$(DEPLOY_HOSTS), \ docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \ ) - + pre-deploy-compose: pre-deploy-docker post-deploy-compose: post-deploy-docker @@ -32,6 +32,7 @@ pull-compose: @- echo "\n### pulling image(s)" @- $(foreach ctx,$(DEPLOY_HOSTS), \ docker context use $(ctx); \ + if [ $(DOCKER_LOGIN) == 'true' ] then docker login -u $(DOCKER_USER) -p $(DOCKER_PASS) $(DOCKER_REGISTRY) fi; \ docker pull $(DOCKER_IMAGE); \ )