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-kogito-apps.git
The following commit(s) were added to refs/heads/main by this push:
new e27436cae NO-ISSUE: Jenkins jobs updates and fixes for Apache 10
release (#2101)
e27436cae is described below
commit e27436cae874d1f282735829edecc18502a896a4
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Mon Oct 7 13:51:22 2024 -0300
NO-ISSUE: Jenkins jobs updates and fixes for Apache 10 release (#2101)
* Adjust release pipelines for the Apache 10 release (#2081)
* Adjust git tag creation for Apache 10 release (#2082)
* Fix release utils (#2088)
* Fix release deploy job running commands on a wrong directory (#2091)
* [10.0.x] NO-ISSUE: Fixes for the release Jenkins and Github workflow jobs
(#2092)
* Fix Skip tests parameter
* Add missing function
* Fix publish-jitexecutor-native-rc github workflow
* Fix jit-executor-rc workflow
* Fix jit-executor-rc workflow
* Remove jit-executor-native workflow job trigger
* Do not import GPG KEY for pull requests
* Do not import GPG KEY for pull requests
---
.ci/jenkins/Jenkinsfile.deploy | 70 ++++---
.ci/jenkins/dsl/jobs.groovy | 2 +-
.../workflows/publish-jitexecutor-native-rc.yml | 228 +++++++++++++++++++--
3 files changed, 257 insertions(+), 43 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy
index 912164d28..58e0c532b 100644
--- a/.ci/jenkins/Jenkinsfile.deploy
+++ b/.ci/jenkins/Jenkinsfile.deploy
@@ -69,7 +69,7 @@ pipeline {
}
stage('Prepare for PR') {
when {
- expression { return isRelease() || isCreatePr() }
+ expression { return isCreatePr() }
}
steps {
script {
@@ -88,14 +88,12 @@ pipeline {
}
steps {
script {
- dir(getRepoName()) {
- configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
- maven.mvnVersionsUpdateParentAndChildModules(
-
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
- getProjectVersion(),
- !isRelease()
- )
- }
+ configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
+ maven.mvnVersionsUpdateParentAndChildModules(
+
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
+ getProjectVersion(),
+ !isRelease()
+ )
}
}
}
@@ -114,20 +112,18 @@ pipeline {
def mavenCommand =
getMavenCommand().withProperty('maven.test.failure.ignore', true)
.withOptions(env.BUILD_MVN_OPTS_CURRENT ? [
env.BUILD_MVN_OPTS_CURRENT ] : [])
.withOptions(env.KOGITO_APPS_BUILD_MVN_OPTS ? [
env.KOGITO_APPS_BUILD_MVN_OPTS ] : [])
- .skipTests(skipTests)
- def Closure mavenRunClosure = {
- configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
-
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
- .run("clean $installOrDeploy")
- }
+ if (params.SKIP_TESTS) {
+ mavenCommand.skipTests()
}
+
if (isRelease()) {
-
release.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
+
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mavenCommand.withProfiles(['apache-release'])
- mavenRunClosure()
- } else {
- mavenRunClosure()
+ }
+
+ configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean
$installOrDeploy")
}
}
}
@@ -143,7 +139,7 @@ pipeline {
}
stage('Create PR') {
when {
- expression { return isRelease() || isCreatePr() }
+ expression { return isCreatePr() }
}
steps {
script {
@@ -167,6 +163,26 @@ pipeline {
}
}
}
+ stage('Commit and Create Tag') {
+ when {
+ expression { return isRelease() }
+ }
+ steps {
+ script {
+ dir(getRepoName()) {
+ if (githubscm.isThereAnyChanges()) {
+ def commitMsg = "[${getBuildBranch()}] Update
version to ${getProjectVersion()}"
+
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
+ githubscm.commitChanges(commitMsg, {
githubscm.findAndStageNotIgnoredFiles('pom.xml') })
+ } else {
+ println '[WARN] no changes to commit'
+ }
+ githubscm.tagRepository(getGitTagName())
+ githubscm.pushRemoteTag('origin', getGitTagName(),
getGitAuthorPushCredsId())
+ }
+ }
+ }
+ }
}
post {
always {
@@ -211,11 +227,7 @@ void checkoutRepo() {
void commitAndCreatePR() {
def commitMsg = "[${getBuildBranch()}] Update version to
${getProjectVersion()}"
def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}."
- if (isRelease()) {
- prBody += '\nPlease do not merge, it should be merged automatically
after testing.'
- } else {
- prBody += '\nPlease review and merge.'
- }
+ prBody += '\nPlease review and merge.'
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges(commitMsg, {
githubscm.findAndStageNotIgnoredFiles('pom.xml') })
githubscm.pushObject('origin', getPRBranch(), getGitAuthorPushCredsId())
@@ -247,6 +259,10 @@ String getGitAuthorCredsId() {
return env.GIT_AUTHOR_CREDS_ID
}
+String getGitAuthorPushCredsId() {
+ return env.GIT_AUTHOR_PUSH_CREDS_ID
+}
+
String getBuildBranch() {
return params.BUILD_BRANCH_NAME
}
@@ -280,3 +296,7 @@ String getReleaseGpgSignKeyCredsId() {
String getReleaseGpgSignPassphraseCredsId() {
return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID
}
+
+String getGitTagName() {
+ return params.GIT_TAG_NAME
+}
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index b3a063293..dbaab3b73 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -239,6 +239,7 @@ void setupReleaseDeployJob() {
booleanParam('CREATE_PR', false, 'Should we create a PR with the
changes ?')
stringParam('PROJECT_VERSION', '', 'Optional if not RELEASE. If
RELEASE, cannot be empty.')
stringParam('KOGITO_PR_BRANCH', '', 'PR branch name')
+ stringParam('GIT_TAG_NAME', '', 'Git tag to create. i.e.:
10.0.0-rc1')
booleanParam('SEND_NOTIFICATION', false, 'In case you want the
pipeline to send a notification on CI channel for this run.')
}
@@ -303,7 +304,6 @@ void setupWeeklyDeployJob() {
booleanParam('SKIP_TESTS', false, 'Skip tests')
-
stringParam('GIT_CHECKOUT_DATETIME', '', 'Git checkout date and
time - (Y-m-d H:i)')
booleanParam('SEND_NOTIFICATION', false, 'In case you want the
pipeline to send a notification on CI channel for this run.')
diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml
b/.github/workflows/publish-jitexecutor-native-rc.yml
index a5cb5a12d..e6893a814 100644
--- a/.github/workflows/publish-jitexecutor-native-rc.yml
+++ b/.github/workflows/publish-jitexecutor-native-rc.yml
@@ -10,6 +10,12 @@ on:
release_candidate_version:
description: "Release candidate version"
required: true
+ drools_repository:
+ description: "Drools repository"
+ required: true
+ kogito_runtimes_repository:
+ description: "Kogito runtimes repository"
+ required: true
jobs:
build_jitexecutor_native:
@@ -28,10 +34,9 @@ jobs:
echo "REF=${{github.event.pull_request.head.ref}}" >>
"$GITHUB_OUTPUT"
echo "PROJECT_VERSION=999-SNAPSHOT" >> "$GITHUB_OUTPUT"
else
- VERSION="${{ github.event.inputs.release_candidate_version }}"
echo "REPOSITORY=apache/incubator-kie-kogito-apps" >>
"$GITHUB_OUTPUT"
- echo "REF=${VERSION//-SNAPSHOT/}" >> "$GITHUB_OUTPUT"
- echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
+ echo "REF=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
+ echo "PROJECT_VERSION=${{
github.event.inputs.release_candidate_version }}" >> "$GITHUB_OUTPUT"
fi
shell: bash
@@ -51,21 +56,200 @@ jobs:
maven-version: 3.9.6
- name: Import GPG key
- uses: crazy-max/ghaction-import-gpg@v6
+ if: github.event_name != 'pull_request'
+ uses:
crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
+ - name: Setup maven settings (Linux and MacOS)
+ if: (runner.os == 'Linux' || runner.os == 'macOS')
+ env:
+ WORKDIR_PATH: ${{ github.workspace }}
+ DROOLS_REPO: ${{ github.event.inputs.drools_repository }}
+ KOGITO_RUNTIMES_REPO: ${{
github.event.inputs.kogito_runtimes_repository }}
+ run: |
+ mkdir -p ${WORKDIR_PATH}/.m2
+ echo "<settings>
+ <servers>
+ <server>
+ <id>apache.releases.https</id>
+ <username>${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}</username>
+ <password>${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}</password>
+ </server>
+ <server>
+ <id>apache.snapshots.https</id>
+ <username>${{ secrets.NEXUS_USER }}</username>
+ <password>${{ secrets.NEXUS_PW }}</password>
+ </server>
+ </servers>
+ <profiles>
+ <profile>
+ <id>additional_repos</id>
+ <repositories>
+ <repository>
+ <id>apache-kie-drools-staging-repository</id>
+ <name>Apache KIE Drools Staging Repository</name>
+ <url>${DROOLS_REPO}</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache-kie-kogito-runtimes-staging-repository</id>
+ <name>Apache KIE Kogito Runtimes Staging Repository</name>
+ <url>${KOGITO_RUNTIMES_REPO}</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache-kie-kogito-runtimes-staging-repository</id>
+ <name>Apache KIE Kogito Runtimes Staging Repository</name>
+ <url>${KOGITO_RUNTIMES_REPO}</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <id>apache-kie-drools-staging-repository</id>
+ <name>Apache KIE Drools Staging Repository</name>
+ <url>${DROOLS_REPO}</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+ <activeProfiles>
+ <activeProfile>additional_repos</activeProfile>
+ </activeProfiles>
+ </settings>" > ${WORKDIR_PATH}/.m2/settings.xml
+
+ - name: Setup maven settings (Windows)
+ if: runner.os == 'Windows'
+ env:
+ WORKDIR_PATH: ${{ github.workspace }}
+ DROOLS_REPO: ${{ github.event.inputs.drools_repository }}
+ KOGITO_RUNTIMES_REPO: ${{
github.event.inputs.kogito_runtimes_repository }}
+ shell: pwsh
+ run: |
+ New-Item -Name ".m2" -Path "$env:WORKDIR_PATH" -ItemType Directory
+ $contentToAdd = @"
+ <settings>
+ <servers>
+ <server>
+ <id>apache.releases.https</id>
+ <username>${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}</username>
+ <password>${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}</password>
+ </server>
+ <server>
+ <id>apache.snapshots.https</id>
+ <username>${{ secrets.NEXUS_USER }}</username>
+ <password>${{ secrets.NEXUS_PW }}</password>
+ </server>
+ </servers>
+ <profiles>
+ <profile>
+ <id>additional_repos</id>
+ <repositories>
+ <repository>
+ <id>apache-kie-kogito-runtimes-staging-repository</id>
+ <name>Apache KIE Kogito Runtimes Staging Repository</name>
+ <url>$env:KOGITO_RUNTIMES_REPO</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache-kie-drools-staging-repository</id>
+ <name>Apache KIE Drools Staging Repository</name>
+ <url>$env:DROOLS_REPO</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache-kie-kogito-runtimes-staging-repository</id>
+ <name>Apache KIE Kogito Runtimes Staging Repository</name>
+ <url>$env:KOGITO_RUNTIMES_REPO</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <id>apache-kie-drools-staging-repository</id>
+ <name>Apache KIE Drools Staging Repository</name>
+ <url>$env:DROOLS_REPO</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+ <activeProfiles>
+ <activeProfile>additional_repos</activeProfile>
+ </activeProfiles>
+ </settings>
+ "@
+ Add-Content "$env:WORKDIR_PATH\.m2\settings.xml" $contentToAdd
+
- name: "Set up JDK 17"
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- server-id: apache.releases.https
- server-username: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}
- server-password: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}
- gpg-private-key: ${{ secrets.GPG_KEY }}
- gpg-passphrase: ""
-
+ overwrite-settings: false
+
- name: "Setup Linux"
if: runner.os == 'Linux'
run: |
@@ -115,16 +299,20 @@ jobs:
- name: "Update versions (Linux and macOS)"
if: (runner.os == 'Linux' || runner.os == 'macOS') &&
github.event_name != 'pull_request'
shell: bash
+ env:
+ SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
- mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true
-DgenerateBackupPoms=false
- mvn -B -fae -ntp -N -e versions:update-child-modules
-DallowSnapshots=true -DgenerateBackupPoms=false
+ mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true
-DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH}
+ mvn -B -fae -ntp -N -e versions:update-child-modules
-DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH}
- name: "Update versions Windows"
if: runner.os == 'Windows' && github.event_name != 'pull_request'
shell: pwsh
+ env:
+ SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml
run: |
- mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true
-DgenerateBackupPoms=false
- mvn -B -fae -ntp -N -e versions:update-child-modules
-DallowSnapshots=true -DgenerateBackupPoms=false
+ mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true
-DgenerateBackupPoms=false -s $env:SETTINGS_FILE_PATH
+ mvn -B -fae -ntp -N -e versions:update-child-modules
-DallowSnapshots=true -DgenerateBackupPoms=false -s $env:SETTINGS_FILE_PATH
- name: "Build macOS"
if: runner.os == 'macOS' && github.event_name == 'pull_request'
@@ -135,8 +323,10 @@ jobs:
- name: "Build and publish macOS"
if: runner.os == 'macOS' && github.event_name != 'pull_request'
shell: bash
+ env:
+ SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
- mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Prelease
+ mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native
-Papache-release -s ${SETTINGS_FILE_PATH}
- name: "Build Linux"
if: runner.os == 'Linux' && github.event_name == 'pull_request'
@@ -147,8 +337,10 @@ jobs:
- name: "Build and Publish Linux"
if: runner.os == 'Linux' && github.event_name != 'pull_request'
shell: bash
+ env:
+ SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
- mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Prelease
+ mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native
-Papache-release -s ${SETTINGS_FILE_PATH}
- name: "Build Windows"
if: runner.os == 'Windows' && github.event_name == 'pull_request'
@@ -159,8 +351,10 @@ jobs:
- name: "Build and Publish Windows"
if: runner.os == 'Windows' && github.event_name != 'pull_request'
shell: pwsh
+ env:
+ SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml
run: |
- mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Prelease
+ mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl
jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native
-Papache-release -s $env:SETTINGS_FILE_PATH
- name: "Upload JIT Executor binary"
uses: actions/upload-artifact@v4
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]