Skip to content

Commit

Permalink
updated Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Oct 17, 2023
1 parent 451095b commit 9c6f9fc
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

pipeline {
agent {
label 'ubuntu'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}
options {
timeout(time: 120, unit: 'MINUTES')
Expand All @@ -11,45 +14,44 @@ pipeline {
stage('Initialization') {
steps {
script {
clean()

sh 'printenv'

githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getChangeTarget(), true)
dir(getRepoName()) {
githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getChangeTarget(), true)
}
}
}
}
stage('Validate CeKit Image and Modules descriptors') {
steps {
script {
sh '''
curl -Ls https://github.com/kiegroup/kie-cloud-tools/releases/download/v1.3.6/cekit-image-validator-runner.tgz --output cekit-image-validator-runner.tgz
tar -xzvf cekit-image-validator-runner.tgz
chmod +x cekit-image-validator-runner
'''
sh './cekit-image-validator-runner modules/'
getImages().each { image -> sh "./cekit-image-validator-runner ${image}-image.yaml" }
dir(getRepoName()) {
sh '''
curl -Ls https://github.com/kiegroup/kie-cloud-tools/releases/download/v1.3.6/cekit-image-validator-runner.tgz --output cekit-image-validator-runner.tgz
tar -xzvf cekit-image-validator-runner.tgz
chmod +x cekit-image-validator-runner
'''
sh './cekit-image-validator-runner modules/'
getImages().each { image -> sh "./cekit-image-validator-runner ${image}-image.yaml" }
}
}
}
}
stage('Build & Test Images') {
steps {
script {
parallelStages = [:]
for(String image : getImages()){
parallelStages[image] = createBuildAndTestStageClosure(image)
dir(getRepoName()) {
parallelStages = [:]
for(String image : getImages()){
parallelStages[image] = createBuildAndTestStageClosure(image)
}
parallel parallelStages
}
parallel parallelStages
}
}
}
}
post {
always {
script {
clean()
}
}
unsuccessful {
script {
pullrequest.postComment(util.getMarkdownTestSummary('PR', "${BUILD_URL}", 'GITHUB'))
Expand All @@ -58,10 +60,6 @@ pipeline {
}
}

void clean() {
util.cleanNode()
}

Closure createBuildAndTestStageClosure(String image) {
return {
stage("Build&Test ${image}") {
Expand Down

0 comments on commit 9c6f9fc

Please sign in to comment.