Skip to content

Commit

Permalink
generate also build-image job
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed Nov 8, 2023
1 parent 987d290 commit b2850db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down Expand Up @@ -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()))
Expand Down
20 changes: 3 additions & 17 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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() {
Expand Down

0 comments on commit b2850db

Please sign in to comment.