Commit 1249be6b authored by Morbi's avatar Morbi

simplify docker job

parent 8de34056
......@@ -6,10 +6,6 @@ stages:
- build
- release
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
get dependencies:
stage: install
script:
......@@ -45,23 +41,18 @@ build:
- dev
- tags
docker build:
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 -t $IMAGE_TAG .
- docker push $IMAGE_TAG
- docker build -t $CI_REGISTRY_IMAGE:$IMAGE_TAG .
- docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG
dependencies:
- build
only:
- master
- dev
- tags
docker build latest:
stage: release
image: docker:latest
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -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