From 85faab5104cef45982ea924f735411e2d794c5ea Mon Sep 17 00:00:00 2001 From: radtriste Date: Tue, 17 Oct 2023 11:06:52 +0200 Subject: [PATCH] update jenkinsfile --- .ci/jenkins/Jenkinsfile | 11 +++++++---- .ci/jenkins/Jenkinsfile.deploy | 18 ++++++------------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 3bc37e894..f73926cb0 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -17,7 +17,10 @@ pipeline { sh 'printenv' dir(getRepoName()) { - githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getChangeTarget(), true) + // 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)) } } } @@ -95,15 +98,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() { diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 00037337e..4441c2731 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -4,9 +4,9 @@ deployProperties = [:] changesDone = false -BUILT_IMAGES = [] -BUILD_FAILED_IMAGES = [] -TEST_FAILED_IMAGES = [] +BUILT_IMAGES = Collections.synchronizedList([]) +BUILD_FAILED_IMAGES = Collections.synchronizedList([]) +TEST_FAILED_IMAGES = Collections.synchronizedList([]) pipeline { agent { @@ -304,21 +304,15 @@ void createBuildAndTestStageClosure(String image) { } void registerBuiltImage(String imageName) { - lock("${BUILD_URL} build success") { - BUILT_IMAGES.add(imageName) - } + BUILT_IMAGES.add(imageName) } void registerBuildFailedImage(String imageName) { - lock("${BUILD_URL} build failed") { - BUILD_FAILED_IMAGES.add(imageName) - } + BUILD_FAILED_IMAGES.add(imageName) } void registerTestFailedImage(String imageName) { - lock("${BUILD_URL} test failed") { - TEST_FAILED_IMAGES.add(imageName) - } + TEST_FAILED_IMAGES.add(imageName) } List getBuiltImages() {