ci(ucslint): Use correct image

Only build the image when ucslint is touched.

Fallback to :latest otherwise.

Bug #55668
This commit is contained in:
Philipp Hahn 2023-03-26 09:29:07 +02:00
parent 5621d1ec8f
commit d570c9e8ac
3 changed files with 16 additions and 7 deletions

View File

@ -79,18 +79,27 @@ drop aptly:
name: $CI_COMMIT_REF_NAME
action: stop
prepare ucslint:
build ucslint:
stage: prepare
interruptible: false
extends: .kaniko
variables:
KANIKO_BUILD_CONTEXT: packaging/ucslint
KANIKO_ARGS: --build-arg ucs=$ucs --cache=true
IMAGE_TAG: ""
rules:
- changes:
- packaging/ucslint/**/*
select ucslint:
stage: prepare
needs:
- job: build ucslint
optional: true
script:
- echo "UCSLINT=${IMAGE_TAG:-$CI_REGISTRY_IMAGE:latest}" | tee .env
artifacts:
reports:
dotenv: .env
doc-pipeline:
stage: build
rules:
@ -138,8 +147,9 @@ deb-pipeline:
needs:
- job: generate-config
- job: prepare aptly
- job: prepare ucslint
optional: true
- job: select ucslint
variables:
UCSLINT: $UCSLINT
trigger:
include:
- artifact: generated-config-deb.yml

View File

@ -5,7 +5,7 @@ stages:
.lint:
stage: lint
image:
name: $IMAGE_TAG
name: $UCSLINT
entrypoint: [""]
script:
- ucslint -j ucslint.xml $base

View File

@ -21,4 +21,3 @@ variables:
DEB: docker-registry.knut.univention.de/phahn/ucs-debbase:$ucs
APTLY: http://omar.knut.univention.de:11620/api
APT: http://omar.knut.univention.de/build2/git
IMAGE_TAG: $CI_REGISTRY_IMAGE