Push tags

This commit is contained in:
Valentin Brandl 2019-04-23 23:58:31 +02:00
parent 69414da8b9
commit 9725170327
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -11,6 +11,7 @@ variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
CONTAINER_TAG_IMAGE: $CI_REGISTRY_IMAGE:${CI_COMMIT_TAG:1}
before_script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
@ -18,10 +19,8 @@ before_script:
build: build:
stage: build stage: build
script: script:
- echo $CI_REGISTRY
- docker build --pull -t $CONTAINER_TEST_IMAGE . - docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE - docker push $CONTAINER_TEST_IMAGE
# - docker build -t vbrandl/hoc:latest .
release-image: release-image:
stage: release stage: release
@ -31,3 +30,15 @@ release-image:
- docker push $CONTAINER_RELEASE_IMAGE - docker push $CONTAINER_RELEASE_IMAGE
only: only:
- master - master
release-tag:
stage: release
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_TAG_IMAGE
only:
- /^v\d+\.\d+\.\d+/
expect:
- branch