ci(backend): add release job to backend-prod downstream pipeline

This commit is contained in:
Sarah Vaupel 2024-09-04 05:28:42 +02:00
parent 034be6e2c9
commit dfc83b7b3c

View File

@ -18,6 +18,7 @@ stages:
- compile
- lint
- test
- release
default:
image:
@ -39,7 +40,7 @@ compile:
artifacts:
paths:
- ${CI_PROJECT_DIR}/.stack-work/
- ${CI_PROJECT_DIR}/.stack/
- bin/
cache: &backend-cache
lint:
@ -55,3 +56,18 @@ test:
script:
- make -- backend-test${PROD_BUILD}
cache: *backend-cache
container:
stage: release
image: ${IMAGE_BUILDER}
needs:
- compile
- lint
- test
script:
- IMAGE_TAG=`./.gitlab-ci/version.pl`
- buildah bud -t ${IMAGE_TAG} --volume ${CI_PROJECT_DIR}/bin/:/tmp/uniworx-bin --file docker/fradrive/Dockerfile
- buildah push --creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" ${IMAGE_TAG} ${CI_REGISTRY_IMAGE}/${IMAGE_TAG}
rules: # should be equivalent to *release-rules in .gitlab-ci.yml
- if: $CI_COMMIT_TAG =~ /^v[0-9\.]+$/
- if: $CI_COMMIT_TAG =~ /^v[0-9\.]+-test-.*$/