Skip to content

gitlab-ci: fix build on merge request with unset variables

A Gitlab "rules" -> "if:" check needs an explicit check against "null" to check for an undefined/empty variable:

Otherwise it will fail with a "yaml error" and the following (misleading) error:

Unable to create pipeline

    'sign manifest' job needs 'build-all: [ath79-generic]' job, but 'build-all: [ath79-generic]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ath79-nand]' job, but 'build-all: [ath79-nand]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ath79-mikrotik]' job, but 'build-all: [ath79-mikrotik]' is not in any previous stage
    'sign manifest' job needs 'build-all: [bcm27xx-bcm2708]' job, but 'build-all: [bcm27xx-bcm2708]' is not in any previous stage
    'sign manifest' job needs 'build-all: [bcm27xx-bcm2709]' job, but 'build-all: [bcm27xx-bcm2709]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ipq40xx-generic]' job, but 'build-all: [ipq40xx-generic]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ipq40xx-mikrotik]' job, but 'build-all: [ipq40xx-mikrotik]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ipq806x-generic]' job, but 'build-all: [ipq806x-generic]' is not in any previous stage
    'sign manifest' job needs 'build-all: [lantiq-xrx200]' job, but 'build-all: [lantiq-xrx200]' is not in any previous stage
    'sign manifest' job needs 'build-all: [lantiq-xway]' job, but 'build-all: [lantiq-xway]' is not in any previous stage
    'sign manifest' job needs 'build-all: [mediatek-mt7622]' job, but 'build-all: [mediatek-mt7622]' is not in any previous stage
    'sign manifest' job needs 'build-all: [mpc85xx-p1010]' job, but 'build-all: [mpc85xx-p1010]' is not in any previous stage
    'sign manifest' job needs 'build-all: [mpc85xx-p1020]' job, but 'build-all: [mpc85xx-p1020]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ramips-mt7620]' job, but 'build-all: [ramips-mt7620]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ramips-mt7621]' job, but 'build-all: [ramips-mt7621]' is not in any previous stage
    'sign manifest' job needs 'build-all: [ramips-mt76x8]' job, but 'build-all: [ramips-mt76x8]' is not in any previous stage
    'sign manifest' job needs 'build-all: [rockchip-armv8]' job, but 'build-all: [rockchip-armv8]' is not in any previous stage
    'sign manifest' job needs 'build-all: [sunxi-cortexa7]' job, but 'build-all: [sunxi-cortexa7]' is not in any previous stage
    'sign manifest' job needs 'build-all: [x86-generic]' job, but 'build-all: [x86-generic]' is not in any previous stage
    'sign manifest' job needs 'build-all: [x86-geode]' job, but 'build-all: [x86-geode]' is not in any previous stage
    'sign manifest' job needs 'build-all: [x86-legacy]' job, but 'build-all: [x86-legacy]' is not in any previous stage
    'sign manifest' job needs 'build-all: [x86-64]' job, but 'build-all: [x86-64]' is not in any previous stage
    'sign manifest' job needs 'generate manifest' job, but 'generate manifest' is not in any previous stage
    'upload' job needs 'generate manifest' job, but 'generate manifest' is not in any previous stage
    'upload-package-registry' job needs 'generate manifest' job, but 'generate manifest' is not in any previous stage

Link: https://docs.gitlab.com/ee/ci/jobs/job_control.html#check-if-a-variable-is-undefined Signed-off-by: Linus Lüssing linus.luessing@c0d3.blue

Merge request reports

Loading