From b2850db186ccca6a63a5b4a07b376feed988e85c Mon Sep 17 00:00:00 2001 From: jstastny-cz Date: Wed, 8 Nov 2023 10:21:35 +0100 Subject: [PATCH] generate also build-image job --- .ci/jenkins/Jenkinsfile | 4 ++-- .ci/jenkins/dsl/jobs.groovy | 20 +++----------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 0715215d3..82afa166f 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { // githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getChangeTarget(), true, credentials = [token: getGitAuthorCredentialsId(), usernamePassword: 'kie-ci']) // TODO Test pupose deleteDir() - checkout(githubscm.resolveRepository('kogito-images', 'radtriste', 'fix-pipelines', false)) + checkout(githubscm.resolveRepository('incubator-kie-kogito-images', 'apache', 'radtriste-fix-pipelines', false)) } } } @@ -67,7 +67,7 @@ Closure createBuildAndTestStageClosure(String image) { return { stage("Build&Test ${image}") { List buildParams = [] - buildParams.add(string(name: "DISPLAY_NAME", value: "PR #${ghprbPullId} - ${image}: ${ghprbPullLink}")) + buildParams.add(string(name: "DISPLAY_NAME", value: "PR #${CHANGE_ID} - ${image}: ${CHANGE_URL}")) buildParams.add(string(name: 'BUILD_IMAGE_NAME', value: image)) buildParams.add(string(name: 'SOURCE_AUTHOR', value: getChangeAuthor())) buildParams.add(string(name: 'SOURCE_BRANCH', value: getChangeBranch())) diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 9b1c3027a..fd72e4069 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -17,7 +17,7 @@ import org.kie.jenkins.jobdsl.Utils jenkins_path = '.ci/jenkins' // PR checks -Utils.isMainBranch(this) && KogitoJobTemplate.createPullRequestMultibranchPipelineJob(this, "${jenkins_path}/Jenkinsfile") +Utils.isMainBranch(this) && KogitoJobTemplate.createPullRequestMultibranchPipelineJob(this, "${jenkins_path}/Jenkinsfile", JobType.PULL_REQUEST.getName()) // Init branch createSetupBranchJob() @@ -40,22 +40,8 @@ setupQuarkusUpdateJob() void setupPrJob() { setupBuildImageJob(JobType.PULL_REQUEST) - def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-images-pr', JobType.PULL_REQUEST, "${jenkins_path}/Jenkinsfile", "Kogito Images PR check") - JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) - jobParams.pr.putAll([ - run_only_for_branches: [ "${GIT_BRANCH}" ], - disable_status_message_error: true, - disable_status_message_failure: true, - commitContext: 'Retrieve and Launch Image Checks', - contextShowtestResults: false, - ]) - if (Utils.hasBindingValue(this, 'CLOUD_IMAGES')) { - jobParams.env.put('IMAGES_LIST', Utils.getBindingValue(this, 'CLOUD_IMAGES')) - } - jobParams.env.putAll([ - AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - ]) - KogitoJobTemplate.createPRJob(this, jobParams) + // Branch Source Plugin multibranchPipelineJob + Utils.isMainBranch(this) && KogitoJobTemplate.createPullRequestMultibranchPipelineJob(this, "${jenkins_path}/Jenkinsfile", JobType.PULL_REQUEST.getName()) } void createSetupBranchJob() {