Skip to content

Commit fcb0dc3

Browse files
committed
fix: Update Docker release and deployment process for improved tagging
Signed-off-by: Mohamad Abuelhagag <mohammed.abuelhagag@gmail.com>
1 parent 0563e3c commit fcb0dc3

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

makefile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ release-pypi:
7373
docker container rm webapp
7474

7575
release-docker:
76-
for tag in "latest" "$(DOCKER_TAG)"; do ( \
77-
export BUILD_TARGET="runtime"; \
78-
export BUILD_TAG="$$tag"; \
79-
export DOCKER_REPO="$(DOCKER_USERNAME)"; \
80-
docker compose build $(DOCKER_BUILD_ARGS); \
81-
) done
76+
export BUILD_TARGET="runtime"; \
77+
export BUILD_TAG="$(DOCKER_TAG)"; \
78+
export VERSION="$(DOCKER_TAG)"; \
79+
export DOCKER_REPO="$(DOCKER_USERNAME)"; \
80+
docker compose build $(DOCKER_BUILD_ARGS) && \
81+
docker compose config --images | grep -v "^$$" | while read image; do \
82+
docker tag "$$image" "$${image%:*}:latest"; \
83+
done
8284

8385
gh-pages-remote:
8486
@git remote add ghp "https://$(GITHUB_AUTH_TOKEN)@github.com/ascoderu/lokole.git" && \
@@ -140,11 +142,11 @@ deploy-pypi:
140142

141143
deploy-docker:
142144
@echo "$(DOCKER_PASSWORD)" | docker login --username "$(DOCKER_USERNAME)" --password-stdin && \
143-
for tag in "latest" "$(DOCKER_TAG)"; do ( \
144-
export BUILD_TAG="$$tag"; \
145-
export DOCKER_REPO="$(DOCKER_USERNAME)"; \
146-
docker compose push; \
147-
) done
145+
export BUILD_TAG="$(DOCKER_TAG)"; \
146+
export DOCKER_REPO="$(DOCKER_USERNAME)"; \
147+
docker compose push && \
148+
export BUILD_TAG="latest"; \
149+
docker compose push
148150

149151
deploy: deploy-pypi deploy-gh-pages deploy-docker
150152
@docker compose -f docker-compose.yml -f docker/docker-compose.setup.yml build setup && \

0 commit comments

Comments
 (0)