This is an automated email from the ASF dual-hosted git repository.
tiagobento 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 275d9e6706c kie-issues#964: Adapt kie-tools Jenkins staging/release
jobs to build and deploy Quarkus Dev UI modules to Nexus/Maven Central (#2245)
275d9e6706c is described below
commit 275d9e6706ce673d14e70bf36ab0c1424d5d663f
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Fri May 24 17:33:34 2024 -0300
kie-issues#964: Adapt kie-tools Jenkins staging/release jobs to build and
deploy Quarkus Dev UI modules to Nexus/Maven Central (#2245)
---
.ci/jenkins/Jenkinsfile.daily-dev-publish | 21 +++
.ci/jenkins/Jenkinsfile.release-build | 44 +++++-
.ci/jenkins/Jenkinsfile.release-dry-run | 2 +-
.ci/jenkins/Jenkinsfile.release-publish | 2 +-
.ci/jenkins/Jenkinsfile.staging-build | 29 +++-
.ci/jenkins/Jenkinsfile.weekly-publish | 4 +-
.../release-jobs/Jenkinsfile.jbpm-quarkus-devui | 147 +++++++++++++++++++++
.../Jenkinsfile.sonataflow-quarkus-devui | 147 +++++++++++++++++++++
.ci/jenkins/shared-scripts/buildUtils.groovy | 4 +-
.ci/jenkins/shared-scripts/chromeStoreUtils.groovy | 4 +-
.ci/jenkins/shared-scripts/dockerUtils.groovy | 2 +-
.ci/jenkins/shared-scripts/githubUtils.groovy | 6 +-
.ci/jenkins/shared-scripts/helmUtils.groovy | 2 +-
.ci/jenkins/shared-scripts/openShiftUtils.groovy | 2 +-
.ci/jenkins/shared-scripts/pipelineVars.groovy | 4 +-
.ci/jenkins/shared-scripts/releaseUtils.groovy | 70 ++++++++++
.ci/jenkins/shared-scripts/zipUtils.groovy | 2 +-
17 files changed, 474 insertions(+), 18 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.daily-dev-publish
b/.ci/jenkins/Jenkinsfile.daily-dev-publish
index fca1daaba91..ff19d2c9a9d 100644
--- a/.ci/jenkins/Jenkinsfile.daily-dev-publish
+++ b/.ci/jenkins/Jenkinsfile.daily-dev-publish
@@ -534,6 +534,27 @@ pipeline {
}
}
}
+
+ stage('Build and Deploy (jbpm-quarkus-devui and
sonataflow-quarkus-devui)') {
+ steps {
+ dir('kie-tools') {
+ script {
+ withCredentials([usernamePassword(credentialsId:
"${pipelineVars.mavenDeployRepositoryCredentialsId}", usernameVariable:
'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+ configFileProvider([configFile(fileId:
"${pipelineVars.mavenSettingsConfigFileId}", variable: 'MAVEN_SETTINGS_FILE')])
{
+ sh """#!/bin/bash -el
+ export KIE_TOOLS_BUILD__mavenDeploySkip=false
+ pnpm -F jbpm-quarkus-devui... -F
sonataflow-quarkus-devui... exec 'bash' '-c' 'echo -e
"\n--settings=${MAVEN_SETTINGS_FILE}" >> .mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F
sonataflow-quarkus-devui... exec 'bash' '-c' 'echo
-Dapache.repository.username=${REPOSITORY_USER} >> .mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F
sonataflow-quarkus-devui... exec 'bash' '-c' 'echo
-Dapache.repository.password=${REPOSITORY_TOKEN} >> .mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F
sonataflow-quarkus-devui... exec 'bash' '-c' 'echo -Drevision=999-SNAPSHOT >>
.mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F
sonataflow-quarkus-devui... build:prod
+ """.trim()
+ }
+ }
+ }
+ }
+ }
+ }
}
post {
diff --git a/.ci/jenkins/Jenkinsfile.release-build
b/.ci/jenkins/Jenkinsfile.release-build
index dbc11495c6f..b003797cb6f 100644
--- a/.ci/jenkins/Jenkinsfile.release-build
+++ b/.ci/jenkins/Jenkinsfile.release-build
@@ -35,7 +35,7 @@ pipeline {
string(description: 'Base Ref', name: 'BASE_REF')
string(description: 'Release Version', name: 'RELEASE_VERSION',
defaultValue: '0.0.0')
string(description: 'Upload asset url', name: 'UPLOAD_ASSET_URL',
defaultValue: '')
- string(description: 'Runners', name: 'RUNNERS', defaultValue:
'{"dev_deployment_base_image":"false","dev_deployment_kogito_quakus_blank_app_image":"false","dev_deployment_dmn_form_webapp_image":"false","dev_deployment_upload_service":"false","kie_sandbox_image":"false","kie_sandbox_extended_services_image":"false","cors_proxy_image":"false","online_editor":"false",
"chrome_extensions":"false","vscode_extensions_dev":"false","vscode_extensions_prod":"false","npm_packages":"false",
[...]
+ string(description: 'Runners', name: 'RUNNERS', defaultValue:
'{"dev_deployment_base_image":"false","dev_deployment_kogito_quakus_blank_app_image":"false","dev_deployment_dmn_form_webapp_image":"false","dev_deployment_upload_service":"false","kie_sandbox_image":"false","kie_sandbox_extended_services_image":"false","cors_proxy_image":"false","online_editor":"false",
"chrome_extensions":"false","vscode_extensions_dev":"false","vscode_extensions_prod":"false","npm_packages":"false",
[...]
}
environment {
@@ -99,6 +99,8 @@ pipeline {
env.KOGITO_SWF_BUILDER = runners.kogito_swf_builder
env.KOGITO_SWF_DEVMODE = runners.kogito_swf_devmode
env.KOGITO_SERVERLESS_OPERATOR =
runners.kogito_serverless_operator
+ env.JBPM_QUARKUS_DEVUI = runners.jbpm_quarkus_devui
+ env.SONATAFLOW_QUARKUS_DEVUI =
runners.sonataflow_quarkus_devui
}
}
}
@@ -132,6 +134,8 @@ pipeline {
echo "kogito_swf_builder: ${env.KOGITO_SWF_BUILDER}"
echo "kogito_swf_devmode: ${env.KOGITO_SWF_DEVMODE}"
echo "kogito_serverless_operator:
${env.KOGITO_SERVERLESS_OPERATOR}"
+ echo "jbpm_quarkus_devui: ${env.JBPM_QUARKUS_DEVUI}"
+ echo "sonataflow_quarkus_devui:
${env.SONATAFLOW_QUARKUS_DEVUI}"
""".trim()
}
}
@@ -446,6 +450,44 @@ pipeline {
}
}
+ stage('JBPM Quarkus Dev UI') {
+ when {
+ expression { env.JBPM_QUARKUS_DEVUI == 'true' }
+ }
+ steps {
+ script {
+ env.JBPM_QUARKUS_DEVUI_JOB_RESULT = build(
+ wait: true,
+ job:
'KIE/kie-tools/kie-tools-release-jobs/jbpm-quarkus-devui',
+ parameters: [
+ booleanParam(name: 'DRY_RUN', value:
"${params.DRY_RUN}"),
+ string(name: 'BASE_REF', value:
"${params.BASE_REF}"),
+ string(name: 'RELEASE_VERSION', value:
"${params.RELEASE_VERSION}")
+ ]
+ ).result
+ }
+ }
+ }
+
+ stage('Sonataflow Quarkus Dev UI') {
+ when {
+ expression { env.SONATAFLOW_QUARKUS_DEVUI == 'true' }
+ }
+ steps {
+ script {
+ env.SONATAFLOW_QUARKUS_DEVUI_JOB_RESULT = build(
+ wait: true,
+ job:
'KIE/kie-tools/kie-tools-release-jobs/sonataflow-quarkus-devui',
+ parameters: [
+ booleanParam(name: 'DRY_RUN', value:
"${params.DRY_RUN}"),
+ string(name: 'BASE_REF', value:
"${params.BASE_REF}"),
+ string(name: 'RELEASE_VERSION', value:
"${params.RELEASE_VERSION}")
+ ]
+ ).result
+ }
+ }
+ }
+
stage('Dependant build #1') {
stages {
stage('Dev Deployment Base Image') {
diff --git a/.ci/jenkins/Jenkinsfile.release-dry-run
b/.ci/jenkins/Jenkinsfile.release-dry-run
index c00b49a4d95..5afed3babde 100644
--- a/.ci/jenkins/Jenkinsfile.release-dry-run
+++ b/.ci/jenkins/Jenkinsfile.release-dry-run
@@ -35,7 +35,7 @@ pipeline {
build job: 'KIE/kie-tools/kie-tools-release-build',
parameters: [
booleanParam(name: 'DRY_RUN', value: true),
string(name: 'BASE_REF', value: 'main'),
- string(name: 'RUNNERS', value:
'{"dev_deployment_base_image":"true","dev_deployment_kogito_quakus_blank_app_image":"true","dev_deployment_dmn_form_webapp_image":"true","dev_deployment_upload_service":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true",
[...]
+ string(name: 'RUNNERS', value:
'{"dev_deployment_base_image":"true","dev_deployment_kogito_quakus_blank_app_image":"true","dev_deployment_dmn_form_webapp_image":"true","dev_deployment_upload_service":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true",
[...]
]
}
}
diff --git a/.ci/jenkins/Jenkinsfile.release-publish
b/.ci/jenkins/Jenkinsfile.release-publish
index e7ec43fca15..00c1b5e619f 100644
--- a/.ci/jenkins/Jenkinsfile.release-publish
+++ b/.ci/jenkins/Jenkinsfile.release-publish
@@ -31,7 +31,7 @@ pipeline {
parameters {
string(description: 'Release Version', name: 'RELEASE_VERSION',
defaultValue: '0.0.0')
- string(description: 'Runners', name: 'RUNNERS', defaultValue:
'{"dev_deployment_base_image":"true","dev_deployment_kogito_quakus_blank_app_image":"true","dev_deployment_dmn_form_webapp_image":"true","dev_deployment_upload_service":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_e
[...]
+ string(description: 'Runners', name: 'RUNNERS', defaultValue:
'{"dev_deployment_base_image":"true","dev_deployment_kogito_quakus_blank_app_image":"true","dev_deployment_dmn_form_webapp_image":"true","dev_deployment_upload_service":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_e
[...]
}
stages {
diff --git a/.ci/jenkins/Jenkinsfile.staging-build
b/.ci/jenkins/Jenkinsfile.staging-build
index dc270d1da89..52b51814667 100644
--- a/.ci/jenkins/Jenkinsfile.staging-build
+++ b/.ci/jenkins/Jenkinsfile.staging-build
@@ -666,6 +666,16 @@ pipeline {
}
}
}
+
+ stage('STAGING: Build and Deploy (jbpm-quarkus-devui and
sonataflow-quarkus-devui)') {
+ steps {
+ dir('kie-tools') {
+ script {
+ buildAndDeployDevUiJavaPackages()
+ }
+ }
+ }
+ }
}
post {
@@ -702,7 +712,6 @@ def build() {
export
SERVERLESS_LOGIC_WEB_TOOLS__samplesRepositoryRef=${params.RELEASE_VERSION}
export SERVERLESS_LOGIC_WEB_TOOLS__buildInfo="${params.RELEASE_VERSION}
(staging) @ ${params.COMMIT_SHA}"
export
SERVERLESS_LOGIC_WEB_TOOLS__corsProxyUrl=https://staging-cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud
-
pnpm -r --workspace-concurrency=1 build:prod
""".trim()
}
@@ -1113,6 +1122,24 @@ def buildImage(String packageName) {
""".trim()
}
+def buildAndDeployDevUiJavaPackages() {
+ withCredentials([usernamePassword(credentialsId:
"${pipelineVars.mavenDeployRepositoryCredentialsId}", usernameVariable:
'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+ configFileProvider([configFile(fileId:
"${pipelineVars.mavenSettingsConfigFileId}", variable: 'MAVEN_SETTINGS_FILE')])
{
+ sh """#!/bin/bash -el
+ export KIE_TOOLS_BUILD__runEndToEndTests=false
+ export KIE_TOOLS_BUILD__runTests=false
+ export KIE_TOOLS_BUILD__runLinters=false
+ export KIE_TOOLS_BUILD__mavenDeploySkip=false
+ pnpm update-version-to ${params.RELEASE_VERSION}-SNAPSHOT -F
jbpm-quarkus-devui... -F sonataflow-quarkus-devui...
+ pnpm -F jbpm-quarkus-devui... -F sonataflow-quarkus-devui... exec
'bash' '-c' 'echo -e "\n--settings=${MAVEN_SETTINGS_FILE}" >> .mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F sonataflow-quarkus-devui... exec
'bash' '-c' 'echo -Dapache.repository.username=${REPOSITORY_USER} >>
.mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F sonataflow-quarkus-devui... exec
'bash' '-c' 'echo -Dapache.repository.password=${REPOSITORY_TOKEN} >>
.mvn/maven.config'
+ pnpm -F jbpm-quarkus-devui... -F sonataflow-quarkus-devui...
build:prod
+ """.trim()
+ }
+ }
+}
+
def loadLocalSharedScripts() {
pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy'
buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy'
diff --git a/.ci/jenkins/Jenkinsfile.weekly-publish
b/.ci/jenkins/Jenkinsfile.weekly-publish
index 2111fcf7dd3..df035d9d1d8 100644
--- a/.ci/jenkins/Jenkinsfile.weekly-publish
+++ b/.ci/jenkins/Jenkinsfile.weekly-publish
@@ -119,10 +119,10 @@ pipeline {
configFileProvider([configFile(fileId:
"${pipelineVars.mavenSettingsConfigFileId}", variable: 'MAVEN_SETTINGS_FILE')])
{
timestampedSnapshotVersion =
getTimestampedSnapshotVersion()
sh """#!/bin/bash -el
- pnpm update-version-to
${timestampedSnapshotVersion} ${env.PNPM_FILTER_STRING}
pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -e "\n--settings=${MAVEN_SETTINGS_FILE}" >> .mvn/maven.config'
pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.username=${REPOSITORY_USER} >> .mvn/maven.config'
pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.password=${REPOSITORY_TOKEN} >>
.mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Drevision=${timestampedSnapshotVersion} >> .mvn/maven.config'
pnpm ${env.PNPM_FILTER_STRING} build:prod
""".trim()
}
@@ -167,7 +167,7 @@ String getTagName() {
String getTimestampedSnapshotVersion() {
if (env.PACKAGE_VERSION == '0.0.0') {
- return "999.0.0-${getDateFromCheckoutDateTime()}-SNAPSHOT"
+ return "999-${getDateFromCheckoutDateTime()}-SNAPSHOT"
}
return "${env.PACKAGE_VERSION}-${getDateFromCheckoutDateTime()}-SNAPSHOT"
}
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.jbpm-quarkus-devui
b/.ci/jenkins/release-jobs/Jenkinsfile.jbpm-quarkus-devui
new file mode 100644
index 00000000000..0dc1c5382b9
--- /dev/null
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.jbpm-quarkus-devui
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+pipeline {
+ agent {
+ docker {
+ image 'quay.io/kie-tools/kie-tools-ci-build:latest'
+ args '--shm-size=2g --privileged --group-add docker'
+ }
+ }
+
+ options {
+ timeout(time: 180, unit: 'MINUTES')
+ }
+
+ parameters {
+ booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue:
true)
+ string(description: 'Release Version', name: 'RELEASE_VERSION',
defaultValue: '0.0.0')
+ string(description: 'Base Ref', name: 'BASE_REF')
+ booleanParam(description: 'Release Candidate', name:
'RELEASE_CANDIDATE', defaultValue: false)
+ }
+
+ environment {
+ KIE_TOOLS_BUILD__runLinters = 'false'
+ KIE_TOOLS_BUILD__runTests = 'false'
+ KIE_TOOLS_BUILD__runEndToEndTests = 'false'
+ KIE_TOOLS_BUILD__mavenDeploySkip = 'false'
+
+ DOCKER_CONFIG = "${WORKSPACE}/.docker"
+
+ PNPM_FILTER_STRING = '-F jbpm-quarkus-devui...'
+ }
+
+ stages {
+ stage('Load local shared scripts') {
+ steps {
+ script {
+ pipelineVars = load
'.ci/jenkins/shared-scripts/pipelineVars.groovy'
+ buildUtils = load
'.ci/jenkins/shared-scripts/buildUtils.groovy'
+ githubUtils = load
'.ci/jenkins/shared-scripts/githubUtils.groovy'
+ releaseUtils = load
'.ci/jenkins/shared-scripts/releaseUtils.groovy'
+ }
+ }
+ }
+
+ stage('Start required services for build and tests (DinD, Xvfb,
Fluxbox)') {
+ steps {
+ script {
+ buildUtils.startRequiredServices()
+ }
+ }
+ }
+
+ stage('Clean workspace before build') {
+ steps {
+ cleanWs(deleteDirs: true, disableDeferredWipeout: true)
+ }
+ }
+
+ stage('Checkout kie-tools') {
+ steps {
+ dir('kie-tools') {
+ script {
+ githubUtils.checkoutRepo(
+
"http://github.com/${pipelineVars.githubRepositorySlug}.git",
+ "${params.BASE_REF}",
+ "${pipelineVars.kieToolsBotGithubCredentialsId}"
+ )
+ }
+ }
+ }
+ }
+
+ stage('Setup PNPM') {
+ steps {
+ dir('kie-tools') {
+ script {
+ buildUtils.setupPnpm()
+ }
+ }
+ }
+ }
+
+ stage('PNPM Bootstrap') {
+ steps {
+ dir('kie-tools') {
+ script {
+ buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}")
+ }
+ }
+ }
+ }
+
+ stage('Setup signing key') {
+ steps {
+ script {
+
releaseUtils.setupSigningKey("${pipelineVars.asfReleaseGPGKeyCredentialsId}",
"${pipelineVars.asfReleaseGPGKeyPasswordCredentialsId}")
+ }
+ }
+ }
+
+ stage('Build and Deploy') {
+ steps {
+ dir('kie-tools') {
+ script {
+ if (params.DRY_RUN) {
+ env.KIE_TOOLS_BUILD__mavenDeploySkip = 'true'
+ }
+ withCredentials([usernamePassword(credentialsId:
"${pipelineVars.mavenDeployRepositoryCredentialsId}", usernameVariable:
'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+ withCredentials([string(credentialsId:
"${pipelineVars.asfReleaseGPGKeyPasswordCredentialsId}", variable:
'SIGNING_KEY_PASSWORD')]) {
+ configFileProvider([configFile(fileId:
"${pipelineVars.mavenSettingsConfigFileId}", variable: 'MAVEN_SETTINGS_FILE')])
{
+ sh """#!/bin/bash -el
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -e "\n--settings=${MAVEN_SETTINGS_FILE}" >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.username=${REPOSITORY_USER} >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.password=${REPOSITORY_TOKEN} >>
.mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dgpg.passphrase=${SIGNING_KEY_PASSWORD} >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Papache-release >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} build:prod
+ """.trim()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ post {
+ always {
+ cleanWs(deleteDirs: true)
+ }
+ }
+}
diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.sonataflow-quarkus-devui
b/.ci/jenkins/release-jobs/Jenkinsfile.sonataflow-quarkus-devui
new file mode 100644
index 00000000000..c5991a61e0f
--- /dev/null
+++ b/.ci/jenkins/release-jobs/Jenkinsfile.sonataflow-quarkus-devui
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+pipeline {
+ agent {
+ docker {
+ image 'quay.io/kie-tools/kie-tools-ci-build:latest'
+ args '--shm-size=2g --privileged --group-add docker'
+ }
+ }
+
+ options {
+ timeout(time: 180, unit: 'MINUTES')
+ }
+
+ parameters {
+ booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue:
true)
+ string(description: 'Release Version', name: 'RELEASE_VERSION',
defaultValue: '0.0.0')
+ string(description: 'Base Ref', name: 'BASE_REF')
+ booleanParam(description: 'Release Candidate', name:
'RELEASE_CANDIDATE', defaultValue: false)
+ }
+
+ environment {
+ KIE_TOOLS_BUILD__runLinters = 'false'
+ KIE_TOOLS_BUILD__runTests = 'false'
+ KIE_TOOLS_BUILD__runEndToEndTests = 'false'
+ KIE_TOOLS_BUILD__mavenDeploySkip = 'false'
+
+ DOCKER_CONFIG = "${WORKSPACE}/.docker"
+
+ PNPM_FILTER_STRING = '-F sonataflow-quarkus-devui...'
+ }
+
+ stages {
+ stage('Load local shared scripts') {
+ steps {
+ script {
+ pipelineVars = load
'.ci/jenkins/shared-scripts/pipelineVars.groovy'
+ buildUtils = load
'.ci/jenkins/shared-scripts/buildUtils.groovy'
+ githubUtils = load
'.ci/jenkins/shared-scripts/githubUtils.groovy'
+ releaseUtils = load
'.ci/jenkins/shared-scripts/releaseUtils.groovy'
+ }
+ }
+ }
+
+ stage('Start required services for build and tests (DinD, Xvfb,
Fluxbox)') {
+ steps {
+ script {
+ buildUtils.startRequiredServices()
+ }
+ }
+ }
+
+ stage('Clean workspace before build') {
+ steps {
+ cleanWs(deleteDirs: true, disableDeferredWipeout: true)
+ }
+ }
+
+ stage('Checkout kie-tools') {
+ steps {
+ dir('kie-tools') {
+ script {
+ githubUtils.checkoutRepo(
+
"http://github.com/${pipelineVars.githubRepositorySlug}.git",
+ "${params.BASE_REF}",
+ "${pipelineVars.kieToolsBotGithubCredentialsId}"
+ )
+ }
+ }
+ }
+ }
+
+ stage('Setup PNPM') {
+ steps {
+ dir('kie-tools') {
+ script {
+ buildUtils.setupPnpm()
+ }
+ }
+ }
+ }
+
+ stage('PNPM Bootstrap') {
+ steps {
+ dir('kie-tools') {
+ script {
+ buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}")
+ }
+ }
+ }
+ }
+
+ stage('Setup signing key') {
+ steps {
+ script {
+
releaseUtils.setupSigningKey("${pipelineVars.asfReleaseGPGKeyCredentialsId}",
"${pipelineVars.asfReleaseGPGKeyPasswordCredentialsId}")
+ }
+ }
+ }
+
+ stage('Build and Deploy') {
+ steps {
+ dir('kie-tools') {
+ script {
+ if (params.DRY_RUN) {
+ env.KIE_TOOLS_BUILD__mavenDeploySkip = 'true'
+ }
+ withCredentials([usernamePassword(credentialsId:
"${pipelineVars.mavenDeployRepositoryCredentialsId}", usernameVariable:
'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+ withCredentials([string(credentialsId:
"${pipelineVars.asfReleaseGPGKeyPasswordCredentialsId}", variable:
'SIGNING_KEY_PASSWORD')]) {
+ configFileProvider([configFile(fileId:
"${pipelineVars.mavenSettingsConfigFileId}", variable: 'MAVEN_SETTINGS_FILE')])
{
+ sh """#!/bin/bash -el
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -e "\n--settings=${MAVEN_SETTINGS_FILE}" >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.username=${REPOSITORY_USER} >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dapache.repository.password=${REPOSITORY_TOKEN} >>
.mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Dgpg.passphrase=${SIGNING_KEY_PASSWORD} >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} exec 'bash'
'-c' 'echo -Papache-release >> .mvn/maven.config'
+ pnpm ${env.PNPM_FILTER_STRING} build:prod
+ """.trim()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ post {
+ always {
+ cleanWs(deleteDirs: true)
+ }
+ }
+}
diff --git a/.ci/jenkins/shared-scripts/buildUtils.groovy
b/.ci/jenkins/shared-scripts/buildUtils.groovy
index 054e9fba624..0a8030ca28e 100644
--- a/.ci/jenkins/shared-scripts/buildUtils.groovy
+++ b/.ci/jenkins/shared-scripts/buildUtils.groovy
@@ -122,7 +122,7 @@ def buildDateTime() {
* @return String the Apache Jenkins agent nodes with higher capacity (builds22
to builds30)
**/
def apacheAgentLabels() {
- return (22..30).collect{"builds$it"}.join(' || ')
+ return (22..30).collect { "builds$it" }.join(' || ')
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/chromeStoreUtils.groovy
b/.ci/jenkins/shared-scripts/chromeStoreUtils.groovy
index d1f64d50a66..209b50dacdf 100644
--- a/.ci/jenkins/shared-scripts/chromeStoreUtils.groovy
+++ b/.ci/jenkins/shared-scripts/chromeStoreUtils.groovy
@@ -39,7 +39,7 @@ def uploadExtension(String chromeStoreCredentialsId, String
chromeStoreRefreshTo
* @return String status
*/
def publishExtension(String chromeStoreCredentialsId, String
chromeStoreRefreshTokenCredentialsId, String chromeExtensionIdCredentialsId) {
- withCredentials([usernamePassword(credentialsId:
"${chromeStoreCredentialsId}", usernameVariable: 'CLIENT_ID', passwordVariable:
'CLIENT_SECRET')]) {
+ withCredentials([usernamePassword(credentialsId:
"${chromeStoreCredentialsId}", usernameVariable: 'CLIENT_ID', passwordVariable:
'CLIENT_SECRET')]) {
withCredentials([string(credentialsId:
"${chromeStoreRefreshTokenCredentialsId}", variable: 'REFRESH_TOKEN')]) {
withCredentials([string(credentialsId:
"${chromeExtensionIdCredentialsId}", variable: 'EXTENSION_ID')]) {
script {
@@ -53,4 +53,4 @@ def publishExtension(String chromeStoreCredentialsId, String
chromeStoreRefreshT
}
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/dockerUtils.groovy
b/.ci/jenkins/shared-scripts/dockerUtils.groovy
index 13c627e229d..975aba221c3 100644
--- a/.ci/jenkins/shared-scripts/dockerUtils.groovy
+++ b/.ci/jenkins/shared-scripts/dockerUtils.groovy
@@ -50,4 +50,4 @@ def tagImage(String registry, String image, String oldTag,
String newTag) {
sh "docker tag ${registry}/${image}:${oldTag}
${registry}/${image}:${newTag}"
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/githubUtils.groovy
b/.ci/jenkins/shared-scripts/githubUtils.groovy
index 1fc48fc451e..bbf28eade07 100644
--- a/.ci/jenkins/shared-scripts/githubUtils.groovy
+++ b/.ci/jenkins/shared-scripts/githubUtils.groovy
@@ -152,8 +152,8 @@ def pushObject(String remote, String object, String
credentialsId) {
*/
def getRepoSlug(String url) {
tokens = url.tokenize('/')
- org = tokens[tokens.size()-4]
- repo = tokens[tokens.size()-3]
+ org = tokens[tokens.size() - 4]
+ repo = tokens[tokens.size() - 3]
return "${org}/${repo}"
}
@@ -178,4 +178,4 @@ def fileIsInChangeset(String file) {
return changeset.contains(file)
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/helmUtils.groovy
b/.ci/jenkins/shared-scripts/helmUtils.groovy
index 7c45e38505a..3081c0c7768 100644
--- a/.ci/jenkins/shared-scripts/helmUtils.groovy
+++ b/.ci/jenkins/shared-scripts/helmUtils.groovy
@@ -26,4 +26,4 @@ def pushChartToRegistry(String registry, String chart, String
credentialsId) {
}
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/openShiftUtils.groovy
b/.ci/jenkins/shared-scripts/openShiftUtils.groovy
index 729c4d7671a..2707a40dd30 100644
--- a/.ci/jenkins/shared-scripts/openShiftUtils.groovy
+++ b/.ci/jenkins/shared-scripts/openShiftUtils.groovy
@@ -74,4 +74,4 @@ def getAppRoute(String project, String appName, String
credentialsId) {
}
}
-return this;
+return this
diff --git a/.ci/jenkins/shared-scripts/pipelineVars.groovy
b/.ci/jenkins/shared-scripts/pipelineVars.groovy
index 517e95d621f..e86f0f95cea 100644
--- a/.ci/jenkins/shared-scripts/pipelineVars.groovy
+++ b/.ci/jenkins/shared-scripts/pipelineVars.groovy
@@ -37,7 +37,9 @@ class PipelineVars implements Serializable {
String mavenSettingsConfigFileId = 'kie-release-settings'
String mavenDeployRepositoryCredentialsId =
'apache-nexus-kie-deploy-credentials'
String defaultArtifactsTempDir = 'artifacts-tmp'
+ String asfReleaseGPGKeyCredentialsId = 'asf-release-gpg-signing-key'
+ String asfReleaseGPGKeyPasswordCredentialsId =
'asf-release-gpg-signing-key-password'
}
-return new PipelineVars();
\ No newline at end of file
+return new PipelineVars()
diff --git a/.ci/jenkins/shared-scripts/releaseUtils.groovy
b/.ci/jenkins/shared-scripts/releaseUtils.groovy
new file mode 100644
index 00000000000..d2e46d2844c
--- /dev/null
+++ b/.ci/jenkins/shared-scripts/releaseUtils.groovy
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+* Setup the GPG Key to sign release artifacts
+*/
+def setupSigningKey(String gpgKeyCredentialsId, String
gpgKeyPasswordCredentialsId) {
+ withCredentials([file(credentialsId: gpgKeyCredentialsId, variable:
'SIGNING_KEY')]) {
+ withCredentials([string(credentialsId: gpgKeyPasswordCredentialsId,
variable: 'SIGNING_KEY_PASSWORD')]) {
+ sh """#!/bin/bash -el
+ cat ${SIGNING_KEY} > ${WORKSPACE}/signkey.gpg
+ gpg --list-keys
+ gpg --batch --pinentry-mode loopback --passphrase
"${SIGNING_KEY_PASSWORD}" --import ${WORKSPACE}/signkey.gpg
+ rm ${WORKSPACE}/signkey.gpg
+ """.trim()
+ }
+ }
+}
+
+/**
+* Sign an artifact using GPG
+*/
+def signArtifact(String artifactFileName, String gpgKeyPasswordCredentialsId) {
+ withCredentials([string(credentialsId: gpgKeyPasswordCredentialsId,
variable: 'SIGNING_KEY_PASSWORD')]) {
+ sh """#!/bin/bash -el
+ echo ${SIGNING_KEY_PASSWORD} | gpg --no-tty --batch --sign
--pinentry-mode loopback --passphrase-fd 0 --output ${artifactFileName}.asc
--detach-sig ${artifactFileName}
+ shasum -a 512 ${artifactFileName} > ${artifactFileName}.sha512
+ """.trim()
+ }
+}
+
+/**
+* Publish release artifacts to a SVN repository
+*/
+def publishArtifacts(String artifactsDir, String releaseRepository, String
releaseVersion, String credentialsId) {
+ withCredentials([usernamePassword(credentialsId: credentialsId,
usernameVariable: 'ASF_USERNAME', passwordVariable: 'ASF_PASSWORD')]) {
+ sh """#!/bin/bash -el
+ svn co --depth=empty ${releaseRepository} svn-kie
+ cp ${artifactsDir}/* svn-kie/${releaseVersion}/
+ svn add "svn-kie/${releaseVersion}"
+ cd svn-kie
+ svn ci --non-interactive --no-auth-cache --username ${ASF_USERNAME}
--password '${ASF_PASSWORD}' -m "Apache KIE ${releaseVersion} artifacts"
+ rm -rf svn-kie
+ """.trim()
+ }
+}
+
+/**
+* Return the final release version from a release candidate version
(10.0.0-rc1 -> 10.0.0)
+*/
+def getFinalReleaseVersion(String releaseCandidateVersion) {
+ finalReleaseVersion = releaseCandidateVersion.replaceAll(/-rc\d{1,2}/, '')
+ return finalReleaseVersion
+}
+
+return this
diff --git a/.ci/jenkins/shared-scripts/zipUtils.groovy
b/.ci/jenkins/shared-scripts/zipUtils.groovy
index 1521ce5312e..9b1be26d90c 100644
--- a/.ci/jenkins/shared-scripts/zipUtils.groovy
+++ b/.ci/jenkins/shared-scripts/zipUtils.groovy
@@ -34,4 +34,4 @@ def unzipArtifact(String filePath, String targetDir) {
""".trim()
}
-return this;
+return this
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]