Commit 4ea9af56 authored by Morbi's avatar Morbi

simplify docker job logic

parent d3a7bf78
Pipeline #433 failed with stages
in 8 seconds
......@@ -7,8 +7,6 @@ stages:
- release
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
IMAGE_ARGS: " --build-arg RELEASE_SHA=$CI_COMMIT_SHA --build-arg RELEASE_NAME=$CI_COMMIT_REF_NAME"
get dependencies:
......@@ -52,19 +50,14 @@ docker image:
stage: release
image: docker:latest
script:
# map master branch to docker :latest
- export IMAGE_TAG=$(echo "$CI_COMMIT_REF_NAME" | sed "s/master/latest/")
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build $IMAGE_ARGS -t $IMAGE_TAG .
- docker push $IMAGE_TAG
- docker build $IMAGE_ARGS -t $CI_REGISTRY_IMAGE:$IMAGE_TAG .
- docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG
dependencies:
- build
only:
- master
- dev
- tags
docker release:
stage: release
image: docker:latest
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build $IMAGE_ARGS -t $IMAGE_TAG_LATEST .
- docker push $IMAGE_TAG_LATEST
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment