From dffd58664752eee0de813b8dcd594adda1ed6a4d Mon Sep 17 00:00:00 2001 From: serverhorror Date: Fri, 8 Mar 2024 19:38:00 +0100 Subject: [PATCH] Fix test `InfrastructureStage does not honor branchToEnvironmentMapping` --- CHANGELOG.md | 1 + src/org/ods/component/InfrastructureStage.groovy | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22da6e21e..4687bd842 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +* Fix InfrastructureStage (org.ods.component) does not honor branchToEnvironmentMapping ([#1076](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1076)) * Fix Tailor deployment drifts for D, Q envs ([#1055](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1055)) * Update api version in ocp templates for image, buildconfig, route and deploymentconfig ([#1072](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1072)) diff --git a/src/org/ods/component/InfrastructureStage.groovy b/src/org/ods/component/InfrastructureStage.groovy index 18ebbe91e..05458181f 100644 --- a/src/org/ods/component/InfrastructureStage.groovy +++ b/src/org/ods/component/InfrastructureStage.groovy @@ -45,6 +45,10 @@ class InfrastructureStage extends Stage { // called from odsComponentStageInfrustructure execute @TypeChecked(TypeCheckingMode.SKIP) protected run() { + if (!context.environment) { + logger.warn('Skipping image import because of empty (target) environment ...') + return + } if (runMakeStage("test", this.options.cloudProvider, environmentVarsTesting, tfBackendS3Key, null as String) != 0) { script.error("IaC - Testing stage failed!")