Skip to content
Snippets Groups Projects
Commit cd98983f authored by Natalia Miakushina's avatar Natalia Miakushina
Browse files

workflow: prevented creating of pipelines for MRs; kaniko-image: tag updated...

workflow: prevented creating of pipelines for MRs; kaniko-image: tag updated to 1.9.1; kaniko-cache: slug for cache-repo corrected; warmer removed
parent d7b0b486
No related branches found
No related tags found
1 merge request!17CI for publish image in our registry for tags and devel-branch
This commit is part of merge request !17. Comments created here will be created in the context of that merge request.
variables:
KANIKO_CACHE_TTL: "2190h0m0s" # three months
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
code-analysis-update:
stage: build
......@@ -29,28 +30,21 @@ code-analysis-update:
update-docker-image:
stage: build
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
# change config for work with our registry
- export REGISTRY_AUTH=$(echo -n $CI_REGISTRY_USER:$CI_JOB_TOKEN | base64)
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"${REGISTRY_AUTH}\"}}}" > /kaniko/.docker/config.json
# cache warmup for further build/push commands
- |
/kaniko/warmer \
--image=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/code-analysis:latest --cache-dir=/cache
# push to our registry
- |
/kaniko/executor \
--context ${CI_PROJECT_DIR}/docker/code-analysis \
--cache --cache-dir=/cache --cache-ttl=${KANIKO_CACHE_TTL} --cache-copy-layers --cache-repo=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/code-analysis \
--dockerfile ${CI_PROJECT_DIR}/docker/code-analysis/Dockerfile \
--destination ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/code-analysis:"${CI_COMMIT_SHORT_SHA}" \
--destination ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/code-analysis:"${CI_COMMIT_REF_NAME}" \
${IS_DEFAULT_BRANCH:+--destination ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/code-analysis:latest}
--cache \
--cache-copy-layers \
--cache-repo "${CI_REGISTRY_IMAGE}/code-analysis" \
--dockerfile "${CI_PROJECT_DIR}/docker/code-analysis/Dockerfile" \
--destination "${CI_REGISTRY_IMAGE}/code-analysis:${CI_COMMIT_SHA}" \
--destination "${CI_REGISTRY_IMAGE}/code-analysis:${CI_COMMIT_REF_SLUG}" \
${IS_DEFAULT_BRANCH:+--destination ${CI_REGISTRY_IMAGE}/code-analysis:latest}
rules:
- if: $CI_PIPELINE_SOURCE == "web" && $REBUILD_DOCKER == "1"
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment