Skip to content
Snippets Groups Projects
Commit 7fd6a4e6 authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

Merge branch 'kaniko-v2' into 'main'

fix: use slug not tag when building the container image

See merge request gitlab-com/gl-infra/common-ci-tasks!49
parents 028ecbdb 5bc2d63a
No related branches found
No related tags found
No related merge requests found
Pipeline #13651639 passed
Loading
Loading
@@ -8,13 +8,32 @@ include:
- local: templates/standard.yml
- local: kaniko.yml
 
#########################################
# Builds an image for running Renovate
container_image_build:
#########################################
.container_builds:
stage: release
variables:
KANIKO_BUILD_FILE: Dockerfile.renovate
KANIKO_EXTRA_ARGS: |
--build-arg GL_COMMON_CI_TASKS_DEFAULT_ASDF_GOLANG_VERSION
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/renovate:${CI_COMMIT_REF_SLUG}
extends:
- .kaniko_base
container_image_build:
variables:
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/renovate:${CI_COMMIT_REF_SLUG}
extends:
- .container_builds
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Tags use the git tag, not the slug
container_image_tagged:
variables:
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/renovate:${CI_COMMIT_TAG}
extends:
- .container_builds
rules:
- if: '$CI_COMMIT_TAG'
Loading
Loading
@@ -11,7 +11,7 @@ include:
ref: v1.20.0 # renovate:managed
file: 'kaniko.yml'
 
container_image_build:
.container_builds:
stage: release
variables:
KANIKO_BUILD_FILE: Dockerfile.alt # Defaults to Dockerfile
Loading
Loading
@@ -19,7 +19,24 @@ container_image_build:
--build-arg GL_ASDF_TFLINT_VERSION
--build-arg GL_ASDF_GOLANG_VERSION
--build-arg GL_DEDICATED_CONTAINER_IMAGE_VERSION_PREFIXED
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/onboard:${CI_COMMIT_REF_SLUG}
extends:
- .kaniko_base
container_image_build:
variables:
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/onboard:${CI_COMMIT_REF_SLUG}
extends:
- .container_builds
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Tags use the git tag, not the slug
container_image_tagged:
variables:
KANIKO_DESTINATION: $CI_REGISTRY_IMAGE/onboard:${CI_COMMIT_TAG}
extends:
- .container_builds
rules:
- if: '$CI_COMMIT_TAG'
```
Loading
Loading
@@ -21,7 +21,3 @@
key: ${CI_JOB_NAME}
paths:
- /cache
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- 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