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

rantunes pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new d2b1df72385 NO-ISSUE: ASF CI Migration - Update Jenkins jobs 
repository names and credentials (#2089)
d2b1df72385 is described below

commit d2b1df723857f013e0a0d9446b6f7e54fc9e27cc
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Tue Dec 12 08:16:03 2023 -0300

    NO-ISSUE: ASF CI Migration - Update Jenkins jobs repository names and 
credentials (#2089)
---
 .ci/jenkins/Jenkinsfile.daily-dev-publish          | 45 +++----------
 .ci/jenkins/Jenkinsfile.staging-build              | 73 +++-------------------
 .../release-jobs/Jenkinsfile.chrome-extensions     | 22 +++----
 .ci/jenkins/release-jobs/Jenkinsfile.online-editor |  8 +--
 .../Jenkinsfile.serverless-logic-web-tools         | 44 -------------
 .../Jenkinsfile.standalone-editors-cdn             |  8 +--
 .ci/jenkins/shared-scripts/githubUtils.groovy      | 45 +++++++------
 .ci/jenkins/shared-scripts/pipelineVars.groovy     |  2 +
 8 files changed, 51 insertions(+), 196 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.daily-dev-publish 
b/.ci/jenkins/Jenkinsfile.daily-dev-publish
index 593264d847c..004c0991c7a 100644
--- a/.ci/jenkins/Jenkinsfile.daily-dev-publish
+++ b/.ci/jenkins/Jenkinsfile.daily-dev-publish
@@ -54,7 +54,7 @@ pipeline {
         ONLINE_EDITOR__devDeploymentDmnFormWebappImageTag = 'daily-dev'
         ONLINE_EDITOR__corsProxyUrl = 
'https://daily-dev-cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud'
 
-        EXTENDED_SERVICES__kieSandboxUrl = 
'https://kiegroup.github.io/kogito-online/dev'
+        EXTENDED_SERVICES__kieSandboxUrl = 
'https://apache.github.io/incubator-kie-kogito-online/dev'
 
         KIE_SANDBOX__imageRegistry = 'quay.io'
         KIE_SANDBOX__imageAccount = 'kie-tools'
@@ -174,10 +174,10 @@ pipeline {
                     sh """#!/bin/bash -el
                     export WEBPACK__minimize=true
                     export WEBPACK__tsLoaderTranspileOnly=false
-                    export 
CHROME_EXTENSION__routerTargetOrigin=https://kiegroup.github.io
-                    export 
CHROME_EXTENSION__routerRelativePath=kogito-online/dev/editors/
-                    export 
SWF_CHROME_EXTENSION__routerTargetOrigin=https://kiegroup.github.io
-                    export 
SWF_CHROME_EXTENSION__routerRelativePath=kogito-online/dev/editors/
+                    export 
CHROME_EXTENSION__routerTargetOrigin=https://apache.github.io
+                    export 
CHROME_EXTENSION__routerRelativePath=incubator-kie-kogito-online/dev/editors/
+                    export 
SWF_CHROME_EXTENSION__routerTargetOrigin=https://apache.github.io
+                    export 
SWF_CHROME_EXTENSION__routerRelativePath=incubator-kie-kogito-online/dev/editors/
                     export 
ONLINE_EDITOR__extendedServicesDownloadUrlLinux=https://github.com/apache/incubator-kie-tools/releases/download/${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}/kie_sandbox_extended_services_linux_${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}.tar.gz
                     export 
ONLINE_EDITOR__extendedServicesDownloadUrlMacOs=https://github.com/apache/incubator-kie-tools/releases/download/${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}/kie_sandbox_extended_services_macos_${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}.dmg
                     export 
ONLINE_EDITOR__extendedServicesDownloadUrlWindows=https://github.com/apache/incubator-kie-tools/releases/download/${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}/kie_sandbox_extended_services_windows_${env.KIE_SANDBOX_EXTENDED_SERVICES_VERSION}.exe
@@ -374,14 +374,12 @@ pipeline {
                 dir('kogito-online') {
                     script {
                         githubUtils.checkoutRepo(
-                            'https://github.com/kiegroup/kogito-online.git',
+                            
'https://github.com/apache/incubator-kie-kogito-online.git',
                             'gh-pages',
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
 
                         sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
                         git checkout gh-pages
                         rm -rf dev && mkdir -p dev/editors
                         cp -RL ../kie-tools/packages/stunner-editors/dist/dmn 
dev/editors/
@@ -393,36 +391,7 @@ pipeline {
                         git add . && git commit -m "Apache KIE Tools Daily Dev 
Build resources - ${env.BUILD_DATE}" || echo 'No changes.'
                         """.trim()
 
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages')
-                        }
-                    }
-                }
-            }
-        }
-
-        stage('Update serverless-logic-sandbox-deployment') {
-            steps {
-                dir('serverless-logic-sandbox-deployment') {
-                    script {
-                        githubUtils.checkoutRepo(
-                            
'https://github.com/kiegroup/serverless-logic-sandbox-deployment.git',
-                            'gh-pages',
-                            "${pipelineVars.kieToolsBotGithubCredentialsId}"
-                        )
-
-                        sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
-                        git checkout gh-pages
-                        rm -rf dev && mkdir dev
-                        cp -r 
../kie-tools/packages/serverless-logic-web-tools/dist/* dev/
-                        git add . && git commit -m "Apache KIE Tools Daily Dev 
Build resources - ${env.BUILD_DATE}" || echo 'No changes.'
-                        """.trim()
-
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/serverless-logic-sandbox-deployment.git
 gh-pages')
-                        }
+                        githubUtils.pushObject('origin', 'gh-pages', 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
diff --git a/.ci/jenkins/Jenkinsfile.staging-build 
b/.ci/jenkins/Jenkinsfile.staging-build
index e55624fc4e4..7d7e6a6f48b 100644
--- a/.ci/jenkins/Jenkinsfile.staging-build
+++ b/.ci/jenkins/Jenkinsfile.staging-build
@@ -147,7 +147,7 @@ pipeline {
                 dir('kogito-online-staging') {
                     script {
                         githubUtils.checkoutRepo(
-                            
'https://github.com/kiegroup/kogito-online-staging.git',
+                            
'https://github.com/apache/incubator-kie-kogito-online-staging.git',
                             'main',
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
@@ -156,23 +156,6 @@ pipeline {
             }
         }
 
-        stage('Checkout serverless-logic-sandbox-deployment') {
-            when {
-                expression { !params.DRY_RUN }
-            }
-            steps {
-                dir('serverless-logic-sandbox-deployment') {
-                    script {
-                        githubUtils.checkoutRepo(
-                            
'https://github.com/kiegroup/serverless-logic-sandbox-deployment.git',
-                            'gh-pages',
-                            "${pipelineVars.kieToolsBotGithubCredentialsId}"
-                        )
-                    }
-                }
-            }
-        }
-
         stage('Setup PNPM') {
             steps {
                 dir('kie-tools') {
@@ -226,20 +209,7 @@ pipeline {
             steps {
                 dir('kogito-online-staging') {
                     script {
-                        deployOnlineEditor("${params.TAG}", 
"${pipelineVars.kieToolsBotGithubCredentialsId}")
-                    }
-                }
-            }
-        }
-
-        stage('STAGING: Deploy Serverless Logic Web Tools to 
serverless-logic-sandbox-deployment') {
-            when {
-                expression { !params.DRY_RUN }
-            }
-            steps {
-                dir('serverless-logic-sandbox-deployment') {
-                    script {
-                        deployServerlessLogicWebTools("${params.TAG}", 
"${pipelineVars.kieToolsBotGithubCredentialsId}")
+                        deployOnlineEditor("${params.TAG}", 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
@@ -842,12 +812,12 @@ def buildPartial(params) {
     export KIE_TOOLS_BUILD__buildContainerImages=true
     export WEBPACK__minimize=true
     export WEBPACK__tsLoaderTranspileOnly=false
-    export CHROME_EXTENSION__routerTargetOrigin=https://kiegroup.github.io
-    export 
CHROME_EXTENSION__routerRelativePath=kogito-online-staging/${params.TAG}-prerelease/chrome-extension
-    export 
CHROME_EXTENSION__onlineEditorUrl=https://kiegroup.github.io/kogito-online-staging/${params.TAG}-prerelease
+    export CHROME_EXTENSION__routerTargetOrigin=https://apache.github.io
+    export 
CHROME_EXTENSION__routerRelativePath=incubator-kie-kogito-online-staging/${params.TAG}-prerelease/chrome-extension
+    export 
CHROME_EXTENSION__onlineEditorUrl=https://apache.github.io/incubator-kie-kogito-online-staging/${params.TAG}-prerelease
     export CHROME_EXTENSION__manifestFile=manifest.prod.json
-    export SWF_CHROME_EXTENSION__routerTargetOrigin=https://kiegroup.github.io
-    export 
SWF_CHROME_EXTENSION__routerRelativePath=kogito-online-staging/${params.TAG}-prerelease/swf-chrome-extension
+    export SWF_CHROME_EXTENSION__routerTargetOrigin=https://apache.github.io
+    export 
SWF_CHROME_EXTENSION__routerRelativePath=incubator-kie-kogito-online-staging/${params.TAG}-prerelease/swf-chrome-extension
     export SWF_CHROME_EXTENSION__manifestFile=manifest.prod.json
     export ONLINE_EDITOR__buildInfo="${params.TAG} (staging) @ 
${params.COMMIT_SHA}"
     export 
ONLINE_EDITOR__extendedServicesDownloadUrlLinux=${params.DOWNLOAD_ASSET_URL}/STAGING__kie_sandbox_extended_services_linux_${params.TAG}.tar.gz
@@ -856,7 +826,7 @@ def buildPartial(params) {
     export ONLINE_EDITOR__extendedServicesCompatibleVersion=${params.TAG}
     export ONLINE_EDITOR__gtmId=""
     export 
ONLINE_EDITOR__corsProxyUrl=https://staging-cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud
-    export 
EXTENDED_SERVICES__kieSandboxUrl=https://kiegroup.github.io/kogito-online-staging/${params.TAG}-prerelease
+    export 
EXTENDED_SERVICES__kieSandboxUrl=https://apache.github.io/incubator-kie-kogito-online-staging/${params.TAG}-prerelease
     export SERVERLESS_LOGIC_WEB_TOOLS__version=${params.TAG}-prerelease
     export SERVERLESS_LOGIC_WEB_TOOLS__samplesRepositoryRef=${params.TAG}
     export SERVERLESS_LOGIC_WEB_TOOLS__buildInfo="${params.TAG} (staging) @ 
${params.COMMIT_SHA}"
@@ -908,30 +878,5 @@ def deployOnlineEditor(String tag, String credentialsId) {
     git commit -m "Deploy ${tag}-prerelease (staging)"
     """.trim()
 
-    withCredentials([usernamePassword(credentialsId: credentialsId, 
usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) {
-        sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online-staging.git 
main')
-    }
-}
-
-def deployServerlessLogicWebTools(String tag, String credentialsId) {
-    DEPLOYMENT_DIR = "staging/${tag}-prerelease"
-
-    sh """#!/bin/bash -el
-    echo "Switch to gh-pages branch"
-    git checkout gh-pages
-
-    echo "Reset deployment dir"
-    rm -rf ${DEPLOYMENT_DIR}
-
-    echo "Copy Serverless Logic Web Tools resources to the deployment dir"
-    cp -r ${WORKSPACE}/kie-tools/packages/serverless-logic-web-tools/dist 
${DEPLOYMENT_DIR}
-
-    echo "Commit changes and push"
-    git add ${DEPLOYMENT_DIR}
-    git commit -m "Deploy ${tag}-prerelease (staging)"
-    """.trim()
-
-    withCredentials([usernamePassword(credentialsId: credentialsId, 
usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) {
-        sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/serverless-logic-sandbox-deployment.git
 gh-pages')
-    }
+    githubUtils.pushObject('origin', 'main', "${credentialsId}")
 }
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions 
b/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions
index 1074ba7c389..342d49a17bd 100644
--- a/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions
@@ -39,11 +39,11 @@ pipeline {
         KIE_TOOLS_BUILD__runEndToEndTests = 'false'
         KIE_TOOLS_BUILD__buildContainerImages = 'true'
 
-        CHROME_EXTENSION__routerTargetOrigin = 'https://kiegroup.github.io'
-        CHROME_EXTENSION__routerRelativePath = 
"kogito-online/chrome-extension/${params.TAG}"
+        CHROME_EXTENSION__routerTargetOrigin = 'https://apache.github.io'
+        CHROME_EXTENSION__routerRelativePath = 
"incubator-kie-kogito-online/chrome-extension/${params.TAG}"
         CHROME_EXTENSION__manifestFile = 'manifest.prod.json'
-        CHROME_EXTENSION__onlineEditorUrl = 
'https://kiegroup.github.io/kogito-online'
-        SWF_CHROME_EXTENSION__routerTargetOrigin = 'https://kiegroup.github.io'
+        CHROME_EXTENSION__onlineEditorUrl = 
'https://apache.github.io/incubator-kie-kogito-online'
+        SWF_CHROME_EXTENSION__routerTargetOrigin = 'https://apache.github.io'
         SWF_CHROME_EXTENSION__routerRelativePath = 
"kogito-online/swf-chrome-extension/${params.TAG}"
         SWF_CHROME_EXTENSION__manifestFile = 'manifest.prod.json'
 
@@ -95,7 +95,7 @@ pipeline {
                 dir('kogito-online') {
                     script {
                         githubUtils.checkoutRepo(
-                            'http://github.com/kiegroup/kogito-online.git',
+                            
'http://github.com/apache/incubator-kie-kogito-online.git',
                             'gh-pages',
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
@@ -162,8 +162,6 @@ pipeline {
                         CHROME_EXTENSION_DIR = "chrome-extension/${params.TAG}"
 
                         sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
                         git checkout gh-pages
 
                         echo "Copy Chrome Extension resources"
@@ -179,9 +177,7 @@ pipeline {
                         git commit -m "Deploy ${params.TAG} (Chrome Extension 
for Kogito KIE Editors)"
                         """.trim()
 
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages')
-                        }
+                        githubUtils.pushObject('origin', 'gh-pages', 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
@@ -267,8 +263,6 @@ pipeline {
                         DEPLOYMENT_DIR = "swf-chrome-extension/${params.TAG}"
 
                         sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
                         git checkout gh-pages
 
                         echo "Copy Chrome Extension resources"
@@ -281,9 +275,7 @@ pipeline {
                         git commit -m "Deploy ${params.TAG} (Chrome Extension 
for Serverless Workflow Editor)"
                         """.trim()
 
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages')
-                        }
+                        githubUtils.pushObject('origin', 'gh-pages', 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.online-editor 
b/.ci/jenkins/release-jobs/Jenkinsfile.online-editor
index a480f2ae374..d29eb30b92a 100644
--- a/.ci/jenkins/release-jobs/Jenkinsfile.online-editor
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.online-editor
@@ -109,7 +109,7 @@ pipeline {
                 dir('kogito-online') {
                     script {
                         githubUtils.checkoutRepo(
-                            'http://github.com/kiegroup/kogito-online.git',
+                            
'http://github.com/apache/incubator-kie-kogito-online.git',
                             'gh-pages',
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
@@ -158,8 +158,6 @@ pipeline {
                         EDITORS_DIR = "editors/${params.TAG}"
 
                         sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
                         git checkout gh-pages
 
                         echo "Reset deployment dir"
@@ -186,9 +184,7 @@ pipeline {
                         git commit -m "Deploy ${params.TAG} (Editors + Online 
Editor)"
                         """.trim()
 
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages')
-                        }
+                        githubUtils.pushObject('origin', 'gh-pages', 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools 
b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools
index bc85c54fb3e..757f703b912 100644
--- a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools
@@ -101,20 +101,6 @@ pipeline {
             }
         }
 
-        stage('Checkout serverless-logic-sandbox-deployment') {
-            steps {
-                dir('serverless-logic-sandbox-deployment') {
-                    script {
-                        githubUtils.checkoutRepo(
-                            
'http://github.com/kiegroup/serverless-logic-sandbox-deployment.git',
-                            'gh-pages',
-                            "${pipelineVars.kieToolsBotGithubCredentialsId}"
-                        )
-                    }
-                }
-            }
-        }
-
         stage('Setup PNPM') {
             steps {
                 dir('kie-tools') {
@@ -144,36 +130,6 @@ pipeline {
                 }
             }
         }
-
-        stage('Deploy to GitHub Pages (serverless-logic-sandbox-deployment)') {
-            when {
-                expression { !params.DRY_RUN }
-            }
-            steps {
-                dir('serverless-logic-sandbox-deployment') {
-                    script {
-                        sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
-                        git checkout gh-pages
-
-                        echo "Reset deployment dir"
-                        shopt -s extglob
-                        rm -rf -- 
!("dev"|"staging"|".nojekyll"|"CNAME"|"0.25.0"|"schemas")
-                        echo "Copy resources"
-                        cp -r 
${WORKSPACE}/kie-tools/packages/serverless-logic-web-tools/dist/* .
-                        echo "Commit changes and push"
-                        git add .
-                        git commit -m "Deploy ${params.TAG}"
-                        """.trim()
-
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/serverless-logic-sandbox-deployment.git
 gh-pages')
-                        }
-                    }
-                }
-            }
-        }
     }
 
     post {
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn 
b/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn
index 2bc77885cd5..52367593089 100644
--- a/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn
@@ -85,7 +85,7 @@ pipeline {
                 dir('kogito-online') {
                     script {
                         githubUtils.checkoutRepo(
-                            'http://github.com/kiegroup/kogito-online.git',
+                            
'http://github.com/apache/incubator-kie-kogito-online.git',
                             'gh-pages',
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
@@ -134,8 +134,6 @@ pipeline {
                         STANDALONE_EDITORS_DIR = "standalone/${params.TAG}"
 
                         sh """#!/bin/bash -el
-                        git config --global user.email '[email protected]'
-                        git config --global user.name 'Apache KIE Tools Bot 
(kiegroup)'
                         git checkout gh-pages
 
                         echo "Copy standalone resources"
@@ -156,9 +154,7 @@ pipeline {
                         git commit -m "Deploy ${params.TAG} (Standalone 
Editors)"
                         """.trim()
 
-                        withCredentials([usernamePassword(credentialsId: 
"${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', 
passwordVariable: 'GH_PASSWORD')]) {
-                            sh('set +x && git push 
https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages')
-                        }
+                        githubUtils.pushObject('origin', 'gh-pages', 
"${pipelineVars.asfGithubPushCredentialsId}")
                     }
                 }
             }
diff --git a/.ci/jenkins/shared-scripts/githubUtils.groovy 
b/.ci/jenkins/shared-scripts/githubUtils.groovy
index 1d082f07ed7..e51f919d053 100644
--- a/.ci/jenkins/shared-scripts/githubUtils.groovy
+++ b/.ci/jenkins/shared-scripts/githubUtils.groovy
@@ -21,7 +21,7 @@
 * @return String with the release information
 */
 def createRelease(String repository, String name, String tag, String commit, 
Boolean draft, Boolean preRelease, String credentialsId) {
-    withCredentials([string(credentialsId: credentialsId, variable: 
'GITHUB_TOKEN')]) {
+    withCredentials([string(credentialsId: "${credentialsId}", variable: 
'GITHUB_TOKEN')]) {
         response = sh returnStdout: true, script: """
         set +x
         curl -L \
@@ -43,7 +43,7 @@ def createRelease(String repository, String name, String tag, 
String commit, Boo
 * @return String with the release information
 */
 def fetchRelease(String repository, String tag, String credentialsId) {
-    withCredentials([string(credentialsId: credentialsId, variable: 
'GITHUB_TOKEN')]) {
+    withCredentials([string(credentialsId: "${credentialsId}", variable: 
'GITHUB_TOKEN')]) {
         response = sh returnStdout: true, script: """
         set +x
         curl -L \
@@ -63,7 +63,7 @@ def fetchRelease(String repository, String tag, String 
credentialsId) {
 * @return String with the release asset information
 */
 def uploadReleaseAsset(String uploadUrl, String assetPath, String assetName, 
String assetContentType, String credentialsId) {
-    withCredentials([string(credentialsId: credentialsId, variable: 
'GITHUB_TOKEN')]) {
+    withCredentials([string(credentialsId: "${credentialsId}", variable: 
'GITHUB_TOKEN')]) {
         response = sh returnStdout: true, script: """
         set +x
         curl -L \
@@ -80,26 +80,6 @@ def uploadReleaseAsset(String uploadUrl, String assetPath, 
String assetName, Str
     }
 }
 
-/**
-* Set build status
-*/
-def commitStatus(String repository, String commit, String context, String 
state, String jobUrl) {
-    withCredentials([string(credentialsId: credentialsId, variable: 
'GITHUB_TOKEN')]) {
-        response = sh returnStdout: true, script: """
-        set +x
-        curl -L \
-        -X POST \
-        -H "Accept: application/vnd.github+json" \
-        -H "Authorization: Bearer ${GITHUB_TOKEN}" \
-        -H "X-GitHub-Api-Version: 2022-11-28" \
-        https://api.github.com/repos/${repository}/statuses/${commit} \
-        -d 
'{"state":"${state}","target_url":"${jobUrl}","description":"${message}","context":"${context}"}'
-        """.trim()
-
-        return response
-    }
-}
-
 /**
 * Parse an release upload asset url to remove unecessary strings
 */
@@ -146,6 +126,25 @@ def checkoutRepoSquashedMerge(String author, String 
branch, String url, String t
     }
 }
 
+/**
+* Pushes a git object to a remote repo
+*/
+def pushObject(String remote, String object, String credentialsId) {
+    withCredentials([usernamePassword(credentialsId: "${credentialsId}", 
usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
+        setUserConfig("${GITHUB_USER}")
+        sh("git config --local credential.helper \"!f() { echo 
username=\\$GITHUB_USER; echo password=\\$GITHUB_TOKEN; }; f\"")
+        sh("git push ${remote} ${object}")
+    }
+}
+
+/**
+* Setup git user configuration
+*/
+def setUserConfig(String username) {
+    sh "git config user.email [email protected]"
+    sh "git config user.name ${username}"
+}
+
 /**
 * @return the Github repository slug (org/repo) from an URL
 */
diff --git a/.ci/jenkins/shared-scripts/pipelineVars.groovy 
b/.ci/jenkins/shared-scripts/pipelineVars.groovy
index 6358d328d07..73090d44e1b 100644
--- a/.ci/jenkins/shared-scripts/pipelineVars.groovy
+++ b/.ci/jenkins/shared-scripts/pipelineVars.groovy
@@ -29,6 +29,8 @@ class PipelineVars implements Serializable {
     String chromeStoreRefreshTokenCredentialsId = 
'kie-tools-chrome-store-refresh-token';
     String npmTokenCredentialsId = 'kie-tools-npm-token';
     String buildKiteTokenCredentialsId = 'kie-tools-build-kite-token';
+    String asfGithubPushCredentialsId = '84811880-2025-45b6-a44c-2f33bef30ad2';
+    String asfGithubTokenPushCredentialsId = 
'41128c14-bb63-4708-9074-d20a318ee630';
 
     String defaultArtifactsTempDir = 'artifacts-tmp';
 


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

Reply via email to