This is an automated email from the ASF dual-hosted git repository.

jstastnycz pushed a commit to branch kie-issues_755
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-serverless-operator.git


The following commit(s) were added to refs/heads/kie-issues_755 by this push:
     new f02c8629 kie-issues#755: initial adjustment for ASF jenkins
f02c8629 is described below

commit f02c862999f1fc2536592a89b58632e4f5d37f81
Author: jstastny-cz <[email protected]>
AuthorDate: Tue Dec 12 12:10:15 2023 +0100

    kie-issues#755: initial adjustment for ASF jenkins
---
 .ci/jenkins/Jenkinsfile.deploy       | 11 ++++-------
 .ci/jenkins/Jenkinsfile.promote      | 19 ++++++++-----------
 .ci/jenkins/Jenkinsfile.setup-branch |  2 +-
 .ci/jenkins/dsl/jobs.groovy          | 14 ++++++++------
 .ci/jenkins/scripts/helper.groovy    | 12 ++++++++----
 5 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy
index a75e6a6c..ae7be292 100644
--- a/.ci/jenkins/Jenkinsfile.deploy
+++ b/.ci/jenkins/Jenkinsfile.deploy
@@ -59,7 +59,6 @@ pipeline {
 
                     // TODO docker buildx could be preinstalled onto the 
docker image
                     
cloud.prepareForDockerMultiplatformBuild([localRegistryUrl],[cloud.getDockerIOMirrorRegistryConfig()],
 false)
-                    cloud.installSkopeo()
                 }
             }
             post {
@@ -81,7 +80,7 @@ pipeline {
             steps {
                 script {
                     if (githubscm.isBranchExist('origin', 
helper.getPRBranch())) {
-                        githubscm.removeRemoteBranch('origin', 
helper.getPRBranch())
+                        githubscm.removeRemoteBranch('origin', 
helper.getPRBranch(), helper.getGitAuthorPushCredsId())
                     }
                     githubscm.createBranch(helper.getPRBranch())
                 }
@@ -206,14 +205,14 @@ pipeline {
             }
             steps {
                 script {
-                    githubscm.pushObject('origin', helper.getPRBranch(), 
helper.getGitAuthorCredsID())
+                    githubscm.pushObject('origin', helper.getPRBranch(), 
helper.getGitAuthorPushCredsId())
 
                     def prMsg = getCommitMessage()
                     def prBody = "Generated by build ${BUILD_TAG}: 
${BUILD_URL}.\nPlease do not merge, it shoud be merged automatically."
-                    String prLink = githubscm.createPR(prMsg, prBody, 
helper.getBuildBranch(), helper.getGitAuthorCredsID())
+                    String prLink = githubscm.createPR(prMsg, prBody, 
helper.getBuildBranch(), helper.getGitAuthorPushCredsId())
                     properties.add("${helper.getRepoName()}.pr.link", prLink)
 
-                    properties.add("${helper.getRepoName()}.pr.source.uri", 
"https://github.com/${helper.getGitAuthorCredsID()}/${helper.getRepoName()}")
+                    properties.add("${helper.getRepoName()}.pr.source.uri", 
"https://github.com/${helper.getGitAuthor()}/${helper.getRepoName()}")
                     properties.add("${helper.getRepoName()}.pr.source.ref", 
helper.getPRBranch())
                     properties.add("${helper.getRepoName()}.pr.target.uri", 
"https://github.com/${helper.getGitAuthor()}/${helper.getRepoName()}")
                     properties.add("${helper.getRepoName()}.pr.target.ref", 
helper.getBuildBranch())
@@ -236,8 +235,6 @@ pipeline {
                 helper.cleanGoPath()
                 util.cleanNode(env.CONTAINER_ENGINE)
                 cloud.cleanDockerMultiplatformBuild()
-                cloud.cleanLocalRegistry()
-                cloud.cleanSkopeo()
             }
         }
     }
diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote
index 5e240a45..2577cff2 100644
--- a/.ci/jenkins/Jenkinsfile.promote
+++ b/.ci/jenkins/Jenkinsfile.promote
@@ -48,8 +48,6 @@ pipeline {
                     // Login old and new registries
                     helper.loginRegistry(baseImageParamsPrefix)
                     helper.loginRegistry(promoteImageParamsPrefix)
-
-                    cloud.installSkopeo()
                 }
             }
         }
@@ -86,8 +84,8 @@ pipeline {
                         // Merge PR
                         String prLink = 
properties.retrieve("${helper.getRepoName()}.pr.link")
                         if (prLink) {
-                            githubscm.mergePR(prLink, 
helper.getGitAuthorCredsID())
-                            githubscm.pushObject('origin', 
helper.getBuildBranch(), helper.getGitAuthorCredsID())
+                            githubscm.mergePR(prLink, 
helper.getGitAuthorPushCredsId())
+                            githubscm.pushObject('origin', 
helper.getBuildBranch(), helper.getGitAuthorPushCredsId())
                         }
 
                         // Tag api / container-builder
@@ -117,13 +115,13 @@ pipeline {
             steps {
                 script {
                     dir(helper.getRepoName()) {
-                        if(githubscm.isReleaseExist(helper.getGitTag(), 
helper.getGitAuthorCredsID())) {
-                            githubscm.deleteReleaseAndTag(helper.getGitTag(), 
helper.getGitAuthorCredsID())
+                        if(githubscm.isReleaseExist(helper.getGitTag(), 
helper.getGitAuthorCredsId())) {
+                            githubscm.deleteReleaseAndTag(helper.getGitTag(), 
helper.getGitAuthorPushCredsId())
                         }
-                        
githubscm.createReleaseWithGeneratedReleaseNotes(helper.getGitTag(), 
helper.getBuildBranch(), 
githubscm.getPreviousTagFromVersion(helper.getProjectVersion(), 'v', '', 
['/']), helper.getGitAuthorCredsID())
-                        githubscm.updateReleaseBody(helper.getGitTag(), 
helper.getGitAuthorCredsID())
+                        
githubscm.createReleaseWithGeneratedReleaseNotes(helper.getGitTag(), 
helper.getBuildBranch(), 
githubscm.getPreviousTagFromVersion(helper.getProjectVersion(), 'v', '', 
['/']), helper.getGitAuthorPushCredsId())
+                        githubscm.updateReleaseBody(helper.getGitTag(), 
helper.getGitAuthorPushCredsId())
     
-                        withCredentials([usernamePassword(credentialsId: 
helper.getGitAuthorCredsID(), usernameVariable: 'GH_USER', passwordVariable: 
'GH_TOKEN')]) {
+                        withCredentials([usernamePassword(credentialsId: 
helper.getGitAuthorPushCredsId(), usernameVariable: 'GH_USER', 
passwordVariable: 'GH_TOKEN')]) {
                             sh """
                                 gh release upload ${helper.getGitTag()} 
"operator.yaml"
                             """
@@ -141,7 +139,6 @@ pipeline {
             script {
                 helper.cleanGoPath()
                 util.cleanNode(containerEngine)
-                cloud.cleanSkopeo()
             }
         }
     }
@@ -169,7 +166,7 @@ void updateInternalGoModuleWithTag(String moduleName, 
String tagName) {
 void commitAndPush(String remote, String commitMsg, Closure preCommit) {
     if (githubscm.isThereAnyChanges()) {
         githubscm.commitChanges(commitMsg, preCommit)
-        githubscm.pushObject(remote, helper.getBuildBranch(), 
helper.getGitAuthorCredsID())
+        githubscm.pushObject(remote, helper.getBuildBranch(), 
helper.getGitAuthorPushCredsId())
     } else {
         echo "No change... Skipping commit and push"
     }
diff --git a/.ci/jenkins/Jenkinsfile.setup-branch 
b/.ci/jenkins/Jenkinsfile.setup-branch
index 63f2cf93..8e4527f6 100644
--- a/.ci/jenkins/Jenkinsfile.setup-branch
+++ b/.ci/jenkins/Jenkinsfile.setup-branch
@@ -74,7 +74,7 @@ pipeline {
                                 git add .
                             '''
                         })
-                        githubscm.pushObject('origin', 
helper.getBuildBranch(), helper.getGitAuthorCredsID())
+                        githubscm.pushObject('origin', 
helper.getBuildBranch(), helper.getGitAuthorPushCredsId())
                     } else {
                         println '[WARN] no changes to commit'
                     }
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index a38d710a..c323f3ad 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -61,8 +61,8 @@ void createSetupBranchJob() {
         JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
 
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
-        AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
-        GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}",
+        GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",
 
         IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
     ])
@@ -86,8 +86,8 @@ void setupDeployJob(JobType jobType) {
         JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
 
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
-        AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
-        GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}",
+        GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",
 
         OPERATOR_IMAGE_NAME: 'kogito-serverless-operator',
         MAX_REGISTRY_RETRIES: 3,
@@ -137,8 +137,8 @@ void setupPromoteJob(JobType jobType) {
 
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
 
-        AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
-        GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}",
+        GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",
     ])
     KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
         parameters {
@@ -182,6 +182,8 @@ void setupE2EJob(JobType jobType, String clusterName, Map 
extraEnv = [:]) {
 
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
 
+        GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+
         OPERATOR_IMAGE_NAME: 'kogito-serverless-operator',
         MAX_REGISTRY_RETRIES: 3,
         PROPERTIES_FILE_NAME: 'deployment.properties',
diff --git a/.ci/jenkins/scripts/helper.groovy 
b/.ci/jenkins/scripts/helper.groovy
index 616e8703..0dae5f03 100644
--- a/.ci/jenkins/scripts/helper.groovy
+++ b/.ci/jenkins/scripts/helper.groovy
@@ -49,7 +49,7 @@ void checkoutRepo(String repoName = '', String directory = 
'') {
     repoName = repoName ?: getRepoName()
     closure = {
         deleteDir()
-        checkout(githubscm.resolveRepository(repoName, getGitAuthor(), 
getBuildBranch(), false))
+        checkout(githubscm.resolveRepository(repoName, getGitAuthor(), 
getBuildBranch(), false, getGitAuthorCredsId()))
         // need to manually checkout branch since on a detached branch after 
checkout command
         //sh "git checkout ${getBuildBranch()}"
     }
@@ -70,7 +70,7 @@ void loginRegistry(String paramsPrefix = 
defaultImageParamsPrefix) {
 }
 
 void createTag(String tagName = getGitTag()) {
-    githubscm.tagLocalAndRemoteRepository('origin', tagName, 
getGitAuthorCredsID(), '', true)
+    githubscm.tagLocalAndRemoteRepository('origin', tagName, 
getGitAuthorPushCredsId(), '', true)
 }
 
 // Set images public on quay. Useful when new images are introduced.
@@ -237,8 +237,12 @@ String getGitAuthor() {
     return "${GIT_AUTHOR}"
 }
 
-String getGitAuthorCredsID() {
-    return env.AUTHOR_CREDS_ID
+String getGitAuthorCredsId() {
+    return env.GIT_AUTHOR_CREDS_ID
+}
+
+String getGitAuthorPushCredsId() {
+    return env.GIT_AUTHOR_PUSH_CREDS_ID
 }
 
 String getPRBranch() {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to