CI: simplify sdk-builder rules, push to own registry, bump Kaniko to 1.9.1

This commit is contained in:
Natalia Miakushina
2023-03-21 17:44:23 +00:00
committed by Roman Azarenko
parent 784bd6250d
commit e46975ddac
2 changed files with 21 additions and 16 deletions

View File

@@ -1,3 +1,7 @@
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
variables:
SKIP_TEST: "false"
@@ -19,7 +23,7 @@ stages:
Update Docker Image:
stage: Update docker image
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
name: gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
@@ -27,20 +31,18 @@ Update Docker Image:
- if [ "${CI_COMMIT_REF_NAME:-}" = "${CI_DEFAULT_BRANCH}" ]; then IS_DEFAULT_BRANCH=1; fi
- |
/kaniko/executor \
--context ${CI_PROJECT_DIR} \
--dockerfile ${CI_PROJECT_DIR}/Dockerfile \
--destination ${REGISTRY_REPOSITORY}:"${CI_COMMIT_SHORT_SHA}" \
--destination ${REGISTRY_REPOSITORY}:"${CI_COMMIT_REF_NAME}" \
${IS_DEFAULT_BRANCH:+--destination ${REGISTRY_REPOSITORY}:latest}
--context "${CI_PROJECT_DIR}" \
--cache \
--cache-copy-layers \
--cache-repo "${CI_REGISTRY_IMAGE}/sdk-builder/cache" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
--destination "${REGISTRY_REPOSITORY}:${CI_COMMIT_SHA}" \
--destination "${CI_REGISTRY_IMAGE}/sdk-builder:${CI_COMMIT_SHA}" \
--destination "${REGISTRY_REPOSITORY}:${CI_COMMIT_REF_SLUG}" \
--destination "${CI_REGISTRY_IMAGE}/sdk-builder:${CI_COMMIT_REF_SLUG}" \
${IS_DEFAULT_BRANCH:+--destination "${REGISTRY_REPOSITORY}:latest" --destination "${CI_REGISTRY_IMAGE}/sdk-builder:latest"}
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^release-\d+\.\d+$/'
changes:
- Dockerfile
- docker/**
- iop
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_REF_PROTECTED'
interruptible: true
code-analysis: