Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pipelines #1706

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 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, credentials = [token: getGitAuthorCredentialsId(), usernamePassword: 'kie-ci'])
}
}
}
}
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 Expand Up @@ -97,15 +95,15 @@ String[] getImages() {
}

String getChangeAuthor() {
return env.ghprbAuthorRepoGitUrl ? util.getGroup(env.ghprbAuthorRepoGitUrl) : (env.ghprbPullAuthorLogin ?: CHANGE_AUTHOR)
return CHANGE_AUTHOR
}

String getChangeBranch() {
return env.ghprbSourceBranch ?: CHANGE_BRANCH
return CHANGE_BRANCH
}

String getChangeTarget() {
return env.ghprbTargetBranch ?: CHANGE_TARGET
return CHANGE_TARGET
}

String getRepoName() {
Expand Down
8 changes: 4 additions & 4 deletions .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ pipeline {
env.MAVEN_MIRROR_URL = env.MAVEN_MIRROR_REPOSITORY

// Ignore self-signed certificates if MAVEN_MIRROR_URL is defined
runPythonCommand("python3 scripts/update-repository.py --build-maven-mirror-url ${MAVEN_MIRROR_URL} --ignore-self-signed-cert")
runPythonCommand("python scripts/update-repository.py --build-maven-mirror-url ${MAVEN_MIRROR_URL} --ignore-self-signed-cert")
}

if (getMavenArtifactRepository()) {
echo "Setup Repository url to '${getMavenArtifactRepository()}'"
runPythonCommand("python3 scripts/update-repository.py --repo-url ${getMavenArtifactRepository()}")
runPythonCommand("python scripts/update-repository.py --repo-url ${getMavenArtifactRepository()}")
}
}
}
Expand All @@ -89,7 +89,7 @@ pipeline {
// echo "[WARN] Artifacts repository defined in env will override the quarkus platform URL in tests. Make sure the platform artifacts are available on that artifacts repository (you can use a maven group)"
// }
// // Setup quarkus platform repo configuration
// runPythonCommand("python3 scripts/update-repository.py --repo-url ${getQuarkusPlatformURL()} --ignore-self-signed-cert --quarkus-platform-version ${quarkusPlatformVersion}")
// runPythonCommand("python scripts/update-repository.py --repo-url ${getQuarkusPlatformURL()} --ignore-self-signed-cert --quarkus-platform-version ${quarkusPlatformVersion}")
// }
// }
// }
Expand Down Expand Up @@ -153,7 +153,7 @@ pipeline {
}
steps {
script {
updateTestsCommand = 'python3 scripts/update-repository.py --tests-only'
updateTestsCommand = 'python scripts/update-repository.py --tests-only'
updateTestsCommand += getMavenArtifactRepository() ? " --repo-url ${getMavenArtifactRepository()}" : ''
updateTestsCommand += getTestsKogitoExamplesRef() ? " --examples-ref ${getTestsKogitoExamplesRef()}" : ''
updateTestsCommand += getTestsKogitoExamplesURI() ? " --examples-uri ${getTestsKogitoExamplesURI()}" : ''
Expand Down
Loading
Loading