From f91e728b919d4704f10ef89ba65ed45db0f5178a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 12 Oct 2022 14:50:34 +0200 Subject: [PATCH] Only push Docker tag to latest when tag doesn't contain alpha, beta or rc Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25507685d..248036677 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -226,22 +226,42 @@ build-docker-main: script: - docker buildx build --push --platform linux/amd64 -t framasoft/mobilizon:main -f docker/production/Dockerfile . -build-docker-tag: +# Don't push to latest when building beta/rc tags +build-and-push-to-latest-docker-tag: <<: *docker rules: &tag-rules - if: '$CI_PROJECT_NAMESPACE != "framasoft"' when: never - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_TAG !~ /alpha|beta|rc/ + when: never timeout: 3 hours script: - > docker buildx build --push - --platform linux/amd64,linux/arm64,linux/arm + --platform linux/amd64,linux/arm -t framasoft/mobilizon:$CI_COMMIT_TAG -t framasoft/mobilizon:latest -f docker/production/Dockerfile . +build-and-push-docker-tag: + <<: *docker + rules: &tag-rules + - if: '$CI_PROJECT_NAMESPACE != "framasoft"' + when: never + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_TAG =~ /alpha|beta|rc/ + when: never + timeout: 3 hours + script: + - > + docker buildx build + --push + --platform linux/amd64,linux/arm + -t framasoft/mobilizon:$CI_COMMIT_TAG + -f docker/production/Dockerfile . + # Packaging app for amd64 package-app: image: mobilizon/buildpack:1.14.1-erlang-25.1.1-debian-buster