Skip to content
Snippets Groups Projects
Commit 8b85dae9 authored by schnarkus's avatar schnarkus
Browse files

tag in a sepate job

parent 743b3d28
No related branches found
No related tags found
No related merge requests found
Pipeline #68711 failed
......@@ -13,6 +13,7 @@ variables:
stages:
- test
- build
- tag
- publish
test_job:
......@@ -33,12 +34,28 @@ build_job:
tags:
- docker-privileged
script:
- docker build -t $CI_REGISTRY_IMAGE:$version -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$environment_tag -f Containerfile .
- docker build -t $CI_REGISTRY_IMAGE:$version -f Containerfile .
artifacts:
paths:
- artifact.bin
expire_in: 5 min
tag_job:
stage: tag
rules:
- if: $CI_COMMIT_REF_NAME == "prod" || $CI_COMMIT_REF_NAME == "dev"
when: always
image: docker:latest
services:
- docker:dind
tags:
- docker-privileged
dependencies:
- build_job
script:
- docker tag $CI_REGISTRY_IMAGE:$version $CI_REGISTRY_IMAGE:latest
- docker tag $CI_REGISTRY_IMAGE:$version $CI_REGISTRY_IMAGE:$environment_tag
publish_job:
stage: publish
rules:
......@@ -49,6 +66,8 @@ publish_job:
- docker:dind
tags:
- docker-privileged
dependencies:
- tag_job
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:$version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment