Skip to content
Snippets Groups Projects
Unverified Commit cfbc9d79 authored by Timo Furrer's avatar Timo Furrer
Browse files

Support custom runner tag for image build job

parent c11f0ebe
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,18 @@ check-semantic-version:
script:
- echo -n "$CI_COMMIT_TAG" | ./.gitlab/scripts/check-semantic-version.sh
gitlab-opentofu-image:build:
.gitlab-opentofu-image:build:base:rules: &gitlab-opentofu-image-build-base-rules
- if: $CI_COMMIT_TAG
- changes:
- Dockerfile.*
- .dockerignore
- opentofu_versions.yaml
- .gitlab-ci.yml
- src/**/*
- templates/**/*
- tests/**/*
.gitlab-opentofu-image:build:base:
extends: '.image-matrix:build'
stage: build
image: quay.io/containers/buildah:v1.37.5
......@@ -149,16 +160,22 @@ gitlab-opentofu-image:build:
--manifest "$GITLAB_OPENTOFU_IMAGE_NAME"
.
- buildah manifest push --all "$GITLAB_OPENTOFU_IMAGE_NAME"
gitlab-opentofu-image:build:
extends: '.gitlab-opentofu-image:build:base'
rules:
- if: $CI_COMMIT_TAG
- changes:
- Dockerfile.*
- .dockerignore
- opentofu_versions.yaml
- .gitlab-ci.yml
- src/**/*
- templates/**/*
- tests/**/*
- if: $OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG
when: never
- *gitlab-opentofu-image-build-base-rules
gitlab-opentofu-image:build:custom-runner:
extends: '.gitlab-opentofu-image:build:base'
tags:
- $OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG
rules:
- if: '$OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG == null || $OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG == ""'
when: never
- *gitlab-opentofu-image-build-base-rules
check-versions:
stage: test
......@@ -237,7 +254,11 @@ gitlab-opentofu-image:deploy:
gitlab-opentofu-image:deploy:dry-run:
extends: ['.gitlab-opentofu-image:deploy:base']
needs: ['gitlab-opentofu-image:build']
needs:
- job: 'gitlab-opentofu-image:build'
optional: true
- job: 'gitlab-opentofu-image:build:custom-runner'
optional: true
script:
- echo "dry run"
rules:
......
......@@ -457,6 +457,9 @@ See also the official GitLab documentation for it
If you want to save runner resources you may disable the unit and integration tests
by setting the `SKIP_TESTS` CI/CD variable to `true`.
You can set the `OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG` CI/CD variable to a custom runner tag
to use for the image build job. This may be useful if you require a dedicated privileged runner.
The pipeline of this component respects the
[GitLab Dependency Proxy](https://docs.gitlab.com/ee/user/packages/dependency_proxy/) configuration
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
......
......@@ -472,6 +472,9 @@ See also the official GitLab documentation for it
If you want to save runner resources you may disable the unit and integration tests
by setting the `SKIP_TESTS` CI/CD variable to `true`.
You can set the `OPENTOFU_COMPONENT_IMAGE_BUILD_RUNNER_TAG` CI/CD variable to a custom runner tag
to use for the image build job. This may be useful if you require a dedicated privileged runner.
The pipeline of this component respects the
[GitLab Dependency Proxy](https://docs.gitlab.com/ee/user/packages/dependency_proxy/) configuration
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment