Commit a0b48858 authored by Benedikt Steinbusch's avatar Benedikt Steinbusch
Browse files

push to container registry only from default branch

parent 8d5537ab
Pipeline #69809 passed with stages
in 5 minutes and 51 seconds
......@@ -10,7 +10,14 @@ default:
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context dir://$CI_PROJECT_DIR/$CI_JOB_NAME --dockerfile $CI_PROJECT_DIR/$CI_JOB_NAME/Dockerfile --destination $CI_REGISTRY_IMAGE/$CI_JOB_NAME:latest
- /kaniko/executor --context dir://$CI_PROJECT_DIR/$CI_JOB_NAME --dockerfile $CI_PROJECT_DIR/$CI_JOB_NAME/Dockerfile $KANIKO_PUSH_POLICY
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
KANIKO_PUSH_POLICY: "--destination $CI_REGISTRY_IMAGE/$CI_JOB_NAME:latest"
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
variables:
KANIKO_PUSH_POLICY: "--no-push"
centos8-eb-base:
extends: .kaniko
......
Supports Markdown
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