Only push Docker tag to latest when tag doesn't contain alpha, beta or rc

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-10-12 14:50:34 +02:00
parent 91e7bd8b68
commit f91e728b91
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -226,22 +226,42 @@ build-docker-main:
script: script:
- docker buildx build --push --platform linux/amd64 -t framasoft/mobilizon:main -f docker/production/Dockerfile . - 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 <<: *docker
rules: &tag-rules rules: &tag-rules
- if: '$CI_PROJECT_NAMESPACE != "framasoft"' - if: '$CI_PROJECT_NAMESPACE != "framasoft"'
when: never when: never
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
- if: $CI_COMMIT_TAG !~ /alpha|beta|rc/
when: never
timeout: 3 hours timeout: 3 hours
script: script:
- > - >
docker buildx build docker buildx build
--push --push
--platform linux/amd64,linux/arm64,linux/arm --platform linux/amd64,linux/arm
-t framasoft/mobilizon:$CI_COMMIT_TAG -t framasoft/mobilizon:$CI_COMMIT_TAG
-t framasoft/mobilizon:latest -t framasoft/mobilizon:latest
-f docker/production/Dockerfile . -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 # Packaging app for amd64
package-app: package-app:
image: mobilizon/buildpack:1.14.1-erlang-25.1.1-debian-buster image: mobilizon/buildpack:1.14.1-erlang-25.1.1-debian-buster