add .gitlab-ci.yml

parent 3807321f
Pipeline #22426 passed with stages
in 1 minute and 39 seconds
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
DOCKER_GIT_IMAGE: registry.itgit.zib.de:5005/pub/docker-git
stages:
- build
- release
.prepare_docker:
before_script: &prepare_docker |
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build_docker_image:
stage: build
image: $DOCKER_GIT_IMAGE
tags:
- docker
before_script:
- *prepare_docker
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release_docker_image:
stage: release
image: $DOCKER_GIT_IMAGE
tags:
- docker
before_script:
- *prepare_docker
script:
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
- docker rmi $IMAGE_TAG
dependencies:
- build_docker_image
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