Commit caa8c30a authored by David Diederich's avatar David Diederich
Browse files

Adding community as a source for release images

parent 08c9b264
Pipeline #11778 failed with stage
in 7 seconds
......@@ -9,29 +9,45 @@ image: docker:19.03
stages:
- build
- release
variables:
COMMUNITY_SHA_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
# These images are the release versions that are stored on community's container service
COMMUNITY_RELEASE_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:$CI_COMMIT_TAG
COMMUNITY_LATEST_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest
# These images are the release versions that are stored on Docker Hub
DOCKER_HUB_RELEASE_IMAGE_TAG: $DOCKER_HUB_ACCOUNT/$CI_PROJECT_NAME:$CI_COMMIT_TAG
DOCKER_HUB_LATEST_IMAGE_TAG: $DOCKER_HUB_ACCOUNT/$CI_PROJECT_NAME:latest
# --------------------------------------------------------------------------------
incremental:
stage: build
tags: ['docker-runner']
variables:
SHA_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $SHA_IMAGE_TAG .
- docker push $SHA_IMAGE_TAG
release:
stage: build
stage: release
tags: ['docker-runner']
only: ['tags']
rules:
- if: $CI_COMMIT_TAG
variables:
RELEASE_IMAGE_TAG: $DOCKER_HUB_ACCOUNT/$CI_PROJECT_NAME:$CI_COMMIT_TAG
LATEST_IMAGE_TAG: $DOCKER_HUB_ACCOUNT/$CI_PROJECT_NAME:latest
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag $COMMUNITY_SHA_IMAGE_TAG $COMMUNITY_RELEASE_IMAGE_TAG
- docker tag $COMMUNITY_SHA_IMAGE_TAG $COMMUNITY_LATEST_IMAGE_TAG
- docker push $COMMUNITY_RELEASE_IMAGE_TAG
- docker push $COMMUNITY_LATEST_IMAGE_TAG
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker build -t $RELEASE_IMAGE_TAG .
- docker tag $RELEASE_IMAGE_TAG $LATEST_IMAGE_TAG
- docker push $RELEASE_IMAGE_TAG
- docker push $LATEST_IMAGE_TAG
- docker tag $COMMUNITY_SHA_IMAGE_TAG $DOCKER_HUB_RELEASE_IMAGE_TAG
- docker tag $COMMUNITY_SHA_IMAGE_TAG $DOCKER_HUB_LATEST_IMAGE_TAG
- docker push $DOCKER_HUB_RELEASE_IMAGE_TAG
- docker push $DOCKER_HUB_LATEST_IMAGE_TAG
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