Only build (and upload) the docker image if we are on master.
This commit is contained in:
parent
d4225a9d4f
commit
f33f2a4cbc
1 changed files with 3 additions and 4 deletions
|
|
@ -43,13 +43,12 @@ deploy_to_test:
|
||||||
oci_calculator:
|
oci_calculator:
|
||||||
# A convenient way for users to run the CARA calculator.
|
# A convenient way for users to run the CARA calculator.
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
rules:
|
||||||
|
# Only run if branch is master (the default branch).
|
||||||
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||||
image:
|
image:
|
||||||
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
|
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
script:
|
script:
|
||||||
# Prepare Kaniko configuration file
|
|
||||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||||
# Build and push the image from the Dockerfile at the root of the project.
|
|
||||||
# To push to a specific docker tag, amend the --destination parameter, e.g. --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|
|
||||||
# See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference for available variables
|
|
||||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/calculator:latest
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/calculator:latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue