You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by js...@apache.org on 2023/11/24 07:05:09 UTC

(incubator-kie-kogito-pipelines) branch push-privilege created (now 91b64cf8)

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

jstastnycz pushed a change to branch push-privilege
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git


      at 91b64cf8 WIP

This branch includes the following new commits:

     new 91b64cf8 WIP

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


(incubator-kie-kogito-pipelines) 01/01: WIP

Posted by js...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jstastnycz pushed a commit to branch push-privilege
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git

commit 91b64cf8d074c85ac1183f6dbc9660098002e302
Author: jstastny-cz <ja...@ibm.com>
AuthorDate: Thu Nov 23 16:59:06 2023 +0100

    WIP
---
 .ci/jenkins/Jenkinsfile.nightly                    | 130 +++++++++++----------
 .ci/jenkins/config/branch.yaml                     |  76 ++++--------
 .ci/jenkins/config/main.yaml                       |   2 +-
 .ci/jenkins/dsl/jobs.groovy                        |   1 +
 .ci/pull-request-config.yaml                       |  12 +-
 .../org/kie/jenkins/jobdsl/KogitoJobUtils.groovy   |   2 +-
 6 files changed, 99 insertions(+), 124 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.nightly b/.ci/jenkins/Jenkinsfile.nightly
index e8880a1d..6240caae 100644
--- a/.ci/jenkins/Jenkinsfile.nightly
+++ b/.ci/jenkins/Jenkinsfile.nightly
@@ -5,7 +5,7 @@ import org.jenkinsci.plugins.workflow.libs.Library
 // Deploy jobs
 RUNTIMES_DEPLOY = 'kogito-runtimes.build-and-deploy'
 APPS_DEPLOY = 'kogito-apps.build-and-deploy'
-EXAMPLES_DEPLOY = 'kogito-examples.build-and-deploy'
+EXAMPLES_DEPLOY = 'kogito-examples.build-and-test'
 QUARKUS_PLATFORM_DEPLOY = 'quarkus-platform.deploy'
 
 // Map of executed jobs
@@ -54,55 +54,55 @@ pipeline {
 
         stage('Build & Deploy artifacts') {
             parallel {
-                stage('Build & Deploy Kogito Runtimes') {
-                    steps {
-                        script {
-                            def buildParams = getDefaultBuildParams()
-                            addSkipTestsParam(buildParams)
-                            addSkipIntegrationTestsParam(buildParams)
-
-                            // images and operator deploy testing will use older working artifacts if that one fails
-                            buildJob(RUNTIMES_DEPLOY, buildParams)
-                        }
-                    }
-                    post {
-                        failure {
-                            addFailedStage(RUNTIMES_DEPLOY)
-                        }
-                    }
-                }
-
-                stage('Build & Deploy Kogito Apps') {
-                    steps {
-                        script {
-                            def buildParams = getDefaultBuildParams()
-                            addSkipTestsParam(buildParams)
-                            addSkipIntegrationTestsParam(buildParams)
-
-                            // images and operator deploy testing will use older working artifacts if that one fails
-                            buildJob(APPS_DEPLOY, buildParams)
-                        }
-                    }
-                    post {
-                        failure {
-                            addFailedStage(APPS_DEPLOY)
-                        }
-                    }
-                }
-
-                stage('Deploy Quarkus platform') {
-                    steps {
-                        script {
-                            def buildParams = getDefaultBuildParams()
-                            buildJob(QUARKUS_PLATFORM_DEPLOY, buildParams)
-                        }
-                    }
-                    post {
-                        failure {
-                            addFailedStage(QUARKUS_PLATFORM_DEPLOY)
-                        }
-                    }
-                }
+                // stage('Build & Deploy Kogito Runtimes') {
+                //     steps {
+                //         script {
+                //             def buildParams = getDefaultBuildParams()
+                //             addSkipTestsParam(buildParams)
+                //             addSkipIntegrationTestsParam(buildParams)
+
+                //             // images and operator deploy testing will use older working artifacts if that one fails
+                //             buildJob(RUNTIMES_DEPLOY, buildParams)
+                //         }
+                //     }
+                //     post {
+                //         failure {
+                //             addFailedStage(RUNTIMES_DEPLOY)
+                //         }
+                //     }
+                // }
+
+                // stage('Build & Deploy Kogito Apps') {
+                //     steps {
+                //         script {
+                //             def buildParams = getDefaultBuildParams()
+                //             addSkipTestsParam(buildParams)
+                //             addSkipIntegrationTestsParam(buildParams)
+
+                //             // images and operator deploy testing will use older working artifacts if that one fails
+                //             buildJob(APPS_DEPLOY, buildParams)
+                //         }
+                //     }
+                //     post {
+                //         failure {
+                //             addFailedStage(APPS_DEPLOY)
+                //         }
+                //     }
+                // }
+
+                // stage('Deploy Quarkus platform') {
+                //     steps {
+                //         script {
+                //             def buildParams = getDefaultBuildParams()
+                //             buildJob(QUARKUS_PLATFORM_DEPLOY, buildParams)
+                //         }
+                //     }
+                //     post {
+                //         failure {
+                //             addFailedStage(QUARKUS_PLATFORM_DEPLOY)
+                //         }
+                //     }
+                // }
 
                 stage('Build & Deploy Kogito Examples') {
                     steps {
@@ -121,7 +121,7 @@ pipeline {
                                     checkout(githubscm.resolveRepository('incubator-kie-kogito-examples', getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
                                     String nightlyBranch = "nightly-${getBuildBranch()}"
                                     githubscm.createBranch(nightlyBranch)
-                                    githubscm.pushObject('origin', nightlyBranch, getGitAuthorCredsID())
+                                    githubscm.pushObject('origin', nightlyBranch, getGitAuthorPushCredsID())
                                 }
                             }
                         }
@@ -135,18 +135,18 @@ pipeline {
             }
         }
 
-        stage('Start Cloud nightly') {
-            when {
-                expression { !params.SKIP_CLOUD_NIGHTLY }
-            }
-            steps {
-                script {
-                    def buildParams = getDefaultBuildParams()
-                    addSkipTestsParam(buildParams)
-                    build(job: './0-kogito-nightly-cloud', wait: false, parameters: buildParams, propagate: false)
-                }
-            }
-        }
+        // stage('Start Cloud nightly') {
+        //     when {
+        //         expression { !params.SKIP_CLOUD_NIGHTLY }
+        //     }
+        //     steps {
+        //         script {
+        //             def buildParams = getDefaultBuildParams()
+        //             addSkipTestsParam(buildParams)
+        //             build(job: './0-kogito-nightly-cloud', wait: false, parameters: buildParams, propagate: false)
+        //         }
+        //     }
+        // }
     }
     post {
         unsuccessful {
@@ -246,3 +246,7 @@ String getGitAuthor() {
 String getGitAuthorCredsID() {
     return env.GIT_AUTHOR_CREDS_ID
 }
+
+String getGitAuthorPushCredsID() {
+    return env.GIT_AUTHOR_PUSH_CREDS_ID
+}
diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml
index 260c2c27..5ff15aac 100644
--- a/.ci/jenkins/config/branch.yaml
+++ b/.ci/jenkins/config/branch.yaml
@@ -1,64 +1,28 @@
-environments:
-  native:
-    env_vars:
-      NATIVE: true
-      BUILD_MVN_OPTS_CURRENT: -Dnative -Dquarkus.native.container-build=true
-      ADDITIONAL_TIMEOUT: 720
-    ids:
-    - native
-  quarkus-main:
-    enabled: false
-    env_vars:
-      QUARKUS_BRANCH: main
-    ids:
-    - quarkus
-  quarkus-branch:
-    env_vars:
-      QUARKUS_BRANCH: '2.16'
-    ids:
-    - quarkus
-  quarkus-3:
-    pull_request_default_check: false
-    env_vars:
-      BUILD_MAVEN_TOOL: maven_3.9.3
-      BUILD_JDK_TOOL: jdk_17_latest
-      BUILD_MVN_OPTS: -Denforcer.skip
-    ids:
-    - quarkus
-    - quarkus3
-  sonarcloud:
-    auto_generation: false
-    env_vars:
-      ENABLE_SONARCLOUD: true
-    ids:
-    - sonarcloud
-    - coverage
-  ecosystem:
-    auto_generation: false
-    ids:
-    - ecosystem
+disable:
+  triggers: true
+  pr_check: true
 repositories:
 - name: incubator-kie-kogito-pipelines
   job_display_name: kogito-pipelines
-- name: incubator-kie-kogito-runtimes
-  job_display_name: kogito-runtimes
-- name: incubator-kie-kogito-apps
-  job_display_name: kogito-apps
+# - name: incubator-kie-kogito-runtimes
+#   job_display_name: kogito-runtimes
+# - name: incubator-kie-kogito-apps
+#   job_display_name: kogito-apps
 - name: incubator-kie-kogito-examples
   job_display_name: kogito-examples
-- name: incubator-kie-kogito-images
-  job_display_name: kogito-images
-- name: incubator-kie-kogito-operator
-  job_display_name: kogito-operator
-- name: incubator-kie-kogito-serverless-operator
-  job_display_name: kogito-serverless-operator
-- name: incubator-kie-kogito-docs
-  job_display_name: kogito-docs
+# - name: incubator-kie-kogito-images
+#   job_display_name: kogito-images
+# - name: incubator-kie-kogito-operator
+#   job_display_name: kogito-operator
+# - name: incubator-kie-kogito-serverless-operator
+#   job_display_name: kogito-serverless-operator
+# - name: incubator-kie-kogito-docs
+#   job_display_name: kogito-docs
 # - name: incubator-kie-tools // Commented as this one will be treated at another time
 #   job_display_name: kie-tools
-- name: incubator-kie-docs
-  job_display_name: kie-docs
-  branch: main-kogito
+# - name: incubator-kie-docs
+#   job_display_name: kie-docs
+#   branch: main-kogito
 git:
   author:
     name: apache
@@ -66,6 +30,9 @@ git:
     # Need to be verified
     credentials_id: 399061d0-5ab5-4142-a186-a52081fef742
     token_credentials_id: ci-builds
+    push:
+      credentials_id: 84811880-2025-45b6-a44c-2f33bef30ad2 # CI Push Access for KIE
+      token_credentials_id: 41128c14-bb63-4708-9074-d20a318ee630 # GitHub Personal Access Token for KIE
   fork_author:
     name: kie-ci
     credentials_id: kie-ci
@@ -78,6 +45,7 @@ git:
 buildchain_config:
   git:
     repository: incubator-kie-kogito-pipelines
+    branch: push-privilege
     file_path: .ci/pull-request-config.yaml
     token_credentials_id: kie-ci3-token
 maven:
diff --git a/.ci/jenkins/config/main.yaml b/.ci/jenkins/config/main.yaml
index dab62f91..e44d761f 100644
--- a/.ci/jenkins/config/main.yaml
+++ b/.ci/jenkins/config/main.yaml
@@ -29,7 +29,7 @@ seed:
       author:
         name: apache
         credentials_id: ASF_Cloudbees_Jenkins_ci-builds
-      branch: main
+      branch: push-privilege
     path: .ci/jenkins/config/branch.yaml
   jenkinsfile: dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
 jenkins:
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index 8f177af6..d13f9fdf 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -170,6 +170,7 @@ void setupNightlyJob() {
         GIT_BRANCH_NAME: "${GIT_BRANCH}",
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
         GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",
     ])
     KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
         parameters {
diff --git a/.ci/pull-request-config.yaml b/.ci/pull-request-config.yaml
index f63835e8..6102f33e 100644
--- a/.ci/pull-request-config.yaml
+++ b/.ci/pull-request-config.yaml
@@ -57,14 +57,16 @@ build:
   - project: apache/incubator-kie-kogito-examples
     build-command:
       # First install the main pom
-      # Then build the required submodule pom
+      # Then build the required submodule pom if provided, otherwise build whole
       current: |
-        export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_EXAMPLES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
-        mvn dependency:tree -pl :kogito-examples clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }}
-        mvn dependency:tree -f ${{ env.KOGITO_EXAMPLES_SUBFOLDER_POM }}pom.xml clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }}
+        mvn dependency:tree -pl :kogito-examples clean install ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }}
+        mvn dependency:tree -f ${{ env.KOGITO_EXAMPLES_SUBFOLDER_POM }}pom.xml clean install ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }}
       upstream: |
         mvn dependency:tree clean install -DskipTests -DskipITs ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS_UPSTREAM }}
-  
+      after:
+        # In case of deploy, deploy the parent poms only.
+        current: |
+          if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then mvn dependency:tree -DskipTests -DskipITs -pl .,kogito-quarkus-examples,kogito-springboot-examples,serverless-workflow-examples deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_EXAMPLES_DEPLOY_MVN_OPTS }}; else echo 'No deploy is scheduled'; fi
   # - project: kiegroup/kie-jpmml-integration
   #   build-command:
   #     current: |
diff --git a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobUtils.groovy b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobUtils.groovy
index 76d42f5f..c7fffd34 100644
--- a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobUtils.groovy
+++ b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobUtils.groovy
@@ -277,7 +277,7 @@ class KogitoJobUtils {
     * See also `createBranchBuildChainJob` method
     */
     static def createNightlyBuildChainBuildAndDeployJob(def script, String envName = '', String repository, Map extraEnv = [:], boolean enableNotification = false, Closure defaultJobParamsGetter = JobParamsUtils.DEFAULT_PARAMS_GETTER) {
-        def jobParams = JobParamsUtils.getSeedJobParamsWithEnv(script, "${Utils.getRepositoryJobDisplayName(script, repository)}.build-and-deploy", JobType.NIGHTLY, envName, KogitoConstants.BUILD_CHAIN_JENKINSFILE, "Build & Test for ${repository} using the build-chain", defaultJobParamsGetter)
+        def jobParams = JobParamsUtils.getSeedJobParamsWithEnv(script, "${Utils.getRepositoryJobDisplayName(script, repository)}.build-and-deploy", JobType.NIGHTLY, envName, KogitoConstants.BUILD_CHAIN_JENKINSFILE, "Build & Deploy for ${repository} using the build-chain", defaultJobParamsGetter)
         JobParamsUtils.setupJobParamsDeployConfiguration(script, jobParams)
         jobParams.env.putAll(extraEnv)
         return createBranchBuildChainJob(script, jobParams, repository, enableNotification, envName)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org