From 47674ba3703188b442c2652745f122d1a562d2b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:30:49 +0200 Subject: [PATCH] CI: deploy pipeline small fix (#1597) (#1598) Co-authored-by: Tristan Radisson --- .ci/jenkins/Jenkinsfile.build-image | 13 ++++++------- .ci/jenkins/Jenkinsfile.deploy | 2 +- scripts/common.py | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.build-image b/.ci/jenkins/Jenkinsfile.build-image index d59d9f79d..9de3849bd 100644 --- a/.ci/jenkins/Jenkinsfile.build-image +++ b/.ci/jenkins/Jenkinsfile.build-image @@ -65,12 +65,6 @@ pipeline { stage('Prepare environment') { steps { script { - cloud.prepareForDockerMultiplatformBuild() - cloud.startLocalRegistry() - if (shouldDeployImage()) { - cloud.installSkopeo() - } - // Set the mirror url only if exist if (env.MAVEN_MIRROR_REPOSITORY) { env.MAVEN_MIRROR_URL = env.MAVEN_MIRROR_REPOSITORY @@ -101,6 +95,9 @@ pipeline { stage('Build image') { steps { script { + cloud.prepareForDockerMultiplatformBuild() + cloud.startLocalRegistry() + // Generate the Dockerfile runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${getBuildImageName()} ignore_test=true ignore_tag=true build_options='--dry-run'") @@ -118,6 +115,8 @@ pipeline { } steps { script { + cloud.installSkopeo() + // Make public if quay registry if (getDeployImageRegistry() == QUAY_REGISTRY) { String namespace = getDeployImageNamespace() @@ -178,7 +177,7 @@ pipeline { docker tag ${builtImageTag} ${testImageTag} """ try { - runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${getBuildImageName()} ignore_build=true ignore_tag=${isProdCI()}") + runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${getBuildImageName()} ignore_build=true") } catch (err) { unstable "Testing error(s) for image ${getBuildImageName()}" } finally { diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index fa7634987..4b804108c 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -292,7 +292,7 @@ void createBuildAndTestStageClosure(String image) { buildParams.add(booleanParam(name: 'DEPLOY_WITH_LATEST_TAG', value: isDeployLatestTag())) def job = build(job: 'kogito-images.build-image', wait: true, parameters: buildParams, propagate: false) - if (!job.result == 'SUCCESS') { + if (job.result != 'SUCCESS') { if (job.result == 'UNSTABLE') { registerTestFailedImage(image) unstable("Tests on ${image} seems to have failed") diff --git a/scripts/common.py b/scripts/common.py index eea855dc2..40b8c7777 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -372,7 +372,7 @@ def update_maven_repo_in_behave_tests(repo_url, replace_jboss_repository): env_var_key = "MAVEN_REPO_URL" if replace_jboss_repository: env_var_key = "JBOSS_MAVEN_REPO_URL" - replacement = "| variable | value |\n | {} | {} |\n | MAVEN_DOWNLOAD_OUTPUT | true |".format(env_var_key, + replacement = "| variable | value |\n | {} | {} |".format(env_var_key, repo_url) update_in_behave_tests(pattern, replacement)