You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ku...@apache.org on 2026/10/15 11:18:54 UTC
(incubator-kie) branch new_test updated: test
This is an automated email from the ASF dual-hosted git repository.
Kusuma04-dev pushed a commit to branch new_test
in repository https://gitbox.apache.org/repos/asf/incubator-kie.git
The following commit(s) were added to refs/heads/new_test by this push:
new aa24e50291d test
aa24e50291d is described below
commit aa24e50291dfe9a74df1e51dc369b0852156f511
Author: Kusuma <ku...@ibm.com>
AuthorDate: Thu Oct 15 16:48:39 2026 +0530
test
---
.ci/jenkins/Jenkinsfile.103xplus.deploy | 187 ++++++++++---------
.ci/jenkins/Jenkinsfile.103xplus.promote | 224 +++++++++++------------
.ci/jenkins/project/Jenkinsfile.103xplus.release | 15 +-
3 files changed, 223 insertions(+), 203 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.103xplus.deploy b/.ci/jenkins/Jenkinsfile.103xplus.deploy
index b220c6a9993..b543ba79999 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.deploy
+++ b/.ci/jenkins/Jenkinsfile.103xplus.deploy
@@ -17,25 +17,23 @@
* under the License.
*/
-// 10.3.x+ deploy pipeline — mirrors Jenkinsfile.deploy with 10.3+ specifics:
-// - no RELEASE env-var path (tagging/signing handled by Jenkinsfile.103xplus.release)
-// - PR creation mode retained for stream-snapshot version bumps
-// - deployment.properties filename to match DSL PROPERTIES_FILE_NAME
-
-import org.jenkinsci.plugins.workflow.libs.Library
-@Library('jenkins-pipeline-shared-libraries')_
-
-import org.kie.jenkins.MavenCommand
+// 10.3.x+ deploy pipeline — no kogito-pipelines dependency.
+// - agent { label 'ubuntu' } + tools block instead of docker { image AGENT_DOCKER_BUILDER_IMAGE }
+// - Maven invoked directly (no MavenCommand shared-library helper)
+// - PR creation via 'gh' CLI instead of githubscm shared-library helpers
+// - @Library removed entirely
deployProperties = [:]
+prBranchHash = ''
pipeline {
agent {
- docker {
- image env.AGENT_DOCKER_BUILDER_IMAGE
- args env.AGENT_DOCKER_BUILDER_ARGS
- label util.avoidFaultyNodes()
- }
+ label 'ubuntu'
+ }
+
+ tools {
+ maven 'maven_3.9.16'
+ jdk 'jdk_17_latest'
}
options {
@@ -45,8 +43,6 @@ pipeline {
environment {
DROOLS_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")
-
- PR_BRANCH_HASH = "${util.generateHash(10)}"
}
stages {
@@ -55,13 +51,14 @@ pipeline {
script {
cleanWs(disableDeferredWipeout: true)
+ prBranchHash = sh(script: 'openssl rand -hex 5', returnStdout: true).trim()
+
if (params.DISPLAY_NAME) {
currentBuild.displayName = params.DISPLAY_NAME
}
if (isCreatePr()) {
- // Verify version is set
- assert getProjectVersion()
+ assert getProjectVersion() : 'PROJECT_VERSION is required when CREATE_PR is true'
}
dir(getRepoName()) {
@@ -87,10 +84,18 @@ pipeline {
steps {
script {
dir(getRepoName()) {
- if (githubscm.isBranchExist('origin', getPRBranch())) {
- githubscm.removeRemoteBranch('origin', getPRBranch(), getGitAuthorPushCredsId())
+ withCredentials([usernamePassword(credentialsId: getGitAuthorPushCredsId(), usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ git config user.email "${env.GIT_AUTHOR_EMAIL ?: 'dev@kie.apache.org'}"
+ git config user.name "${env.GIT_AUTHOR ?: 'Apache KIE Release Bot'}"
+ git config --local credential.helper '!f() { echo username=\$GITHUB_USER; echo password=\$GITHUB_TOKEN; }; f'
+ if git ls-remote --exit-code origin '${getPRBranch()}'; then
+ git push origin --delete '${getPRBranch()}' || true
+ fi
+ git checkout -b '${getPRBranch()}'
+ """
}
- githubscm.createBranch(getPRBranch())
}
}
}
@@ -104,11 +109,14 @@ pipeline {
script {
dir(getRepoName()) {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
- maven.mvnVersionsSet(
- getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
- getProjectVersion(),
- !isStreamDevVersion()
- )
+ def snapshotFlag = isStreamDevVersion() ? '' : '-DgenerateBackupPoms=false'
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ mvn -s "\${MAVEN_SETTINGS_FILE}" -B -ntp \
+ versions:set \
+ -DnewVersion='${getProjectVersion()}' \
+ ${snapshotFlag}
+ """
}
}
}
@@ -119,22 +127,32 @@ pipeline {
steps {
script {
dir(getRepoName()) {
- withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
- def installOrDeploy
- if (shouldDeployToRepository()) {
- installOrDeploy = "deploy -DdeployAtEnd -Dapache.repository.username=${REPOSITORY_USER} -Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5"
- } else {
- installOrDeploy = 'install'
- }
- def mavenCommand = getMavenCommand()
- .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
- .withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : [])
- .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : [])
- .withProperty('maven.test.failure.ignore', true)
- .skipTests(params.SKIP_TESTS)
-
- configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
- mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean ${installOrDeploy}")
+ configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+ withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+ def goal
+ if (shouldDeployToRepository()) {
+ goal = "deploy -DdeployAtEnd -Dapache.repository.username=\${REPOSITORY_USER} -Dapache.repository.password=\${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5"
+ } else {
+ goal = 'install'
+ }
+
+ def extraOpts = [
+ env.BUILD_MVN_OPTS,
+ env.DROOLS_BUILD_MVN_OPTS,
+ env.BUILD_MVN_OPTS_CURRENT
+ ].findAll { it }.join(' ')
+
+ def skipTestsFlag = params.SKIP_TESTS ? '-DskipTests' : ''
+
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ mvn -s "\${MAVEN_SETTINGS_FILE}" -B -ntp -fae \
+ -Dfull \
+ ${skipTestsFlag} \
+ -Dmaven.test.failure.ignore=true \
+ ${extraOpts} \
+ clean ${goal}
+ """
}
}
}
@@ -145,7 +163,7 @@ pipeline {
script {
dir(getRepoName()) {
saveReports()
- util.archiveConsoleLog()
+ archiveArtifacts(artifacts: 'build_logs/**', allowEmptyArchive: true)
}
}
}
@@ -159,10 +177,36 @@ pipeline {
steps {
script {
dir(getRepoName()) {
- if (githubscm.isThereAnyChanges()) {
- commitAndCreatePR()
- } else {
- println '[WARN] no changes to commit'
+ withCredentials([usernamePassword(credentialsId: getGitAuthorPushCredsId(), usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
+ def prLink = sh(script: """#!/usr/bin/env bash
+ set -euo pipefail
+ git config --local credential.helper '!f() { echo username=\$GITHUB_USER; echo password=\$GITHUB_TOKEN; }; f'
+
+ # Stage only pom.xml and antora.yml changes (version bump files)
+ git add -A -- '*.xml' '*/antora.yml' 2>/dev/null || true
+ if git diff --cached --quiet; then
+ echo '[WARN] no changes to commit' >&2
+ echo ''
+ exit 0
+ fi
+
+ COMMIT_MSG="[${getBuildBranch()}] Update version to ${getProjectVersion()}"
+ git commit -m "\${COMMIT_MSG}"
+ git push origin '${getPRBranch()}'
+
+ PR_BODY="Generated by build ${BUILD_TAG}: ${BUILD_URL}.\\nPlease do not merge, it should be merged automatically."
+ gh pr create \
+ --repo '${getGitAuthor()}/${getRepoName()}' \
+ --head '${getPRBranch()}' \
+ --base '${getBuildBranch()}' \
+ --title "\${COMMIT_MSG}" \
+ --body "\${PR_BODY}" \
+ --label 'skip-ci'
+ """, returnStdout: true).trim()
+
+ if (prLink) {
+ deployProperties["${getRepoName()}.pr.link"] = prLink
+ }
}
}
}
@@ -192,9 +236,7 @@ pipeline {
sendNotification()
}
cleanup {
- script {
- util.cleanNode()
- }
+ cleanWs()
}
}
}
@@ -205,26 +247,23 @@ void saveReports() {
void checkoutRepo() {
deleteDir()
- checkout(githubscm.resolveRepository(getRepoName(), getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsId()))
- // need to manually checkout branch since on a detached branch after checkout command
+ checkout([$class: 'GitSCM',
+ branches: [[name: "*/${getBuildBranch()}"]],
+ userRemoteConfigs: [[
+ url: "https://github.com/${getGitAuthor()}/${getRepoName()}.git",
+ credentialsId: getGitAuthorCredsId()
+ ]]
+ ])
sh "git checkout ${getBuildBranch()}"
}
-void commitAndCreatePR() {
- def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}"
- def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}.\nPlease do not merge, it should be merged automatically."
- githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
- githubscm.commitChanges(commitMsg, {
- githubscm.findAndStageNotIgnoredFiles('pom.xml')
- githubscm.findAndStageNotIgnoredFiles('antora.yml')
- })
- githubscm.pushObject('origin', getPRBranch(), getGitAuthorPushCredsId())
- deployProperties["${getRepoName()}.pr.link"] = githubscm.createPRWithLabels(commitMsg, prBody, getBuildBranch(), ['skip-ci'] as String[], getGitAuthorCredsId())
-}
-
void sendNotification() {
if (params.SEND_NOTIFICATION) {
- mailer.sendMarkdownTestSummaryNotification('Deploy', "[${getBuildBranch()}] Drools", [env.DROOLS_CI_EMAIL_TO])
+ mail(
+ to: env.DROOLS_CI_EMAIL_TO,
+ subject: "[FAILURE] Deploy [${getBuildBranch()}] Drools - Build ${BUILD_TAG}",
+ body: "Deploy pipeline failed.\n\nBuild URL: ${BUILD_URL}"
+ )
} else {
echo 'No notification sent per configuration'
}
@@ -239,9 +278,6 @@ boolean isCreatePr() {
}
boolean isStreamDevVersion() {
- // STREAM_DEV_VERSION is not a DSL param for the 103xplus deploy job.
- // A "stream dev" version is any snapshot version (contains -SNAPSHOT),
- // mirroring the old Jenkinsfile.deploy's !isRelease() logic.
return getProjectVersion()?.contains('-SNAPSHOT') ?: false
}
@@ -250,7 +286,6 @@ String getRepoName() {
}
String getGitAuthor() {
- // GIT_AUTHOR can be env or param
return "${GIT_AUTHOR}"
}
@@ -263,8 +298,7 @@ String getProjectVersion() {
}
String getPRBranch() {
- // PR_BRANCH_PREFIX is not a DSL param; fall back to a safe generated name.
- return params.DROOLS_PR_BRANCH ?: "drools-${getProjectVersion()}_${PR_BRANCH_HASH}"
+ return params.DROOLS_PR_BRANCH ?: "drools-${getProjectVersion()}_${prBranchHash}"
}
String getGitAuthorCredsId() {
@@ -280,14 +314,3 @@ void setDeployPropertyIfNeeded(String key, def value) {
deployProperties[key] = value
}
}
-
-MavenCommand getMavenCommand() {
- def mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
- .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
- .withProperty('full')
- return mvnCmd
-}
-
-String getGitTagName() {
- return params.GIT_TAG_NAME
-}
\ No newline at end of file
diff --git a/.ci/jenkins/Jenkinsfile.103xplus.promote b/.ci/jenkins/Jenkinsfile.103xplus.promote
index 42fe1efc6ed..73d72b043a4 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.promote
+++ b/.ci/jenkins/Jenkinsfile.103xplus.promote
@@ -17,27 +17,28 @@
* under the License.
*/
-// 10.3.x+ promote pipeline — mirrors Jenkinsfile.promote with 10.3+ specifics:
-// - 'Create release' stage uses Nexus nexus-staging:release (same as old)
-// - 'Tag final release' stage delegates to 05-tag-release.sh (tags the
-// approved RC commit, not the branch tip as the old pipeline did)
-// - 'Upload drools binaries and documentation' stage retained for main stream
-
-import org.jenkinsci.plugins.workflow.libs.Library
-@Library('jenkins-pipeline-shared-libraries')_
-
-import org.kie.jenkins.MavenCommand
+// 10.3.x+ promote pipeline — no kogito-pipelines dependency.
+// - agent { label 'ubuntu' } + tools block instead of docker { image AGENT_DOCKER_BUILDER_IMAGE }
+// - Maven invoked directly (no MavenCommand shared-library helper)
+// - PR merge and GitHub release creation via 'gh' CLI instead of githubscm helpers
+// - @Library removed entirely
+//
+// Stage notes:
+// 'Tag final release' — delegates to 05-tag-release.sh so the tag always
+// points to the approved RC commit, not the branch tip.
+// 'Create release' — uses 'gh release create' with auto-generated notes.
+// 'Upload drools ...' — calls upload_filemgmt.sh inside sshagent, same as before.
deployProperties = [:]
-pipelineProperties = [:]
pipeline {
agent {
- docker {
- image env.AGENT_DOCKER_BUILDER_IMAGE
- args env.AGENT_DOCKER_BUILDER_ARGS
- label util.avoidFaultyNodes()
- }
+ label 'ubuntu'
+ }
+
+ tools {
+ maven 'maven_3.9.16'
+ jdk 'jdk_17_latest'
}
options {
@@ -61,25 +62,36 @@ pipeline {
readDeployProperties()
- assert getProjectVersion()
- assert getBuildBranch() == util.getReleaseBranchFromVersion(getProjectVersion())
+ assert getProjectVersion() : 'PROJECT_VERSION is required'
+ // Build branch must match the release version stream (e.g. 10.3.0 -> 10.3.x)
+ def expectedBranch = getProjectVersion().replaceFirst(/(\d+\.\d+)\.\d+.*/, '$1.x')
+ assert getBuildBranch() == expectedBranch : \
+ "BUILD_BRANCH_NAME '${getBuildBranch()}' does not match version '${getProjectVersion()}' (expected '${expectedBranch}')"
// GIT_TAG must be the approved RC tag; the final tag is derived from it.
- assert getRcTag() ==~ /.+-rc[0-9]+/ : "GIT_TAG must be the approved RC tag (e.g. 10.3.0-rc2), got '${getRcTag()}'"
+ assert getRcTag() ==~ /.+-rc[0-9]+/ : \
+ "GIT_TAG must be the approved RC tag (e.g. 10.3.0-rc2), got '${getRcTag()}'"
}
}
}
stage('Merge deploy PR') {
- // NOTE: tagLatest() removed here intentionally.
- // In the 103xplus flow the final release tag is created by the
- // separate "Tag final release" stage below, which delegates to
- // 05-tag-release.sh so the tag always points to the approved
- // RC commit — NOT the current branch tip. Calling tagLatest()
- // here would create a duplicate tag at the wrong commit.
+ // NOTE: the final release tag is created by 'Tag final release' below,
+ // which delegates to 05-tag-release.sh so the tag always points to the
+ // approved RC commit — NOT the current branch tip.
steps {
script {
+ def prLink = getDeployPrLink()
+ if (prLink?.trim()) {
+ withCredentials([usernamePassword(credentialsId: getGitAuthorPushCredsId(), usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ git config --local credential.helper '!f() { echo username=\$GITHUB_USER; echo password=\$GITHUB_TOKEN; }; f'
+ gh pr review '${prLink}' --approve
+ gh pr merge '${prLink}' --merge --auto
+ """
+ }
+ }
dir(getRepoName()) {
- approveAndMergePR(getDeployPrLink())
checkoutRepo()
}
}
@@ -89,10 +101,7 @@ pipeline {
stage('Tag final release') {
// Delegate final-tag creation to 05-tag-release.sh so the release tag
// always points to the approved RC commit — NOT the current branch tip.
- // This matches the documented strategy: the R commit lives under the RC
- // tag only; the development branch is never disturbed.
- // Runs before 'Create release' so the GitHub release attaches to this
- // tag instead of creating one at the branch tip.
+ // Runs before 'Create release' so the GitHub release attaches to this tag.
steps {
withCredentials([
usernamePassword(credentialsId: env.GIT_AUTHOR_PUSH_CREDS_ID, usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')
@@ -118,13 +127,28 @@ pipeline {
stage('Create release') {
steps {
script {
- dir(getRepoName()) {
- checkoutRepo()
- if (githubscm.isReleaseExist(getGitTag(), getGitAuthorCredsId())) {
- githubscm.deleteRelease(getGitTag(), getGitAuthorPushCredsId())
- }
- githubscm.createReleaseWithGeneratedReleaseNotes(getGitTag(), getBuildBranch(), githubscm.getPreviousTagFromVersion(getGitTag()), getGitAuthorPushCredsId())
- githubscm.updateReleaseBody(getGitTag(), getGitAuthorPushCredsId())
+ withCredentials([usernamePassword(credentialsId: getGitAuthorPushCredsId(), usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ git config --local credential.helper '!f() { echo username=\$GITHUB_USER; echo password=\$GITHUB_TOKEN; }; f'
+
+ # Delete any pre-existing release so we can re-create it cleanly.
+ if gh release view '${getGitTag()}' --repo '${getGitAuthor()}/${getRepoName()}' &>/dev/null; then
+ gh release delete '${getGitTag()}' \
+ --repo '${getGitAuthor()}/${getRepoName()}' \
+ --yes
+ fi
+
+ # Derive the previous tag for release-note generation.
+ PREV_TAG="\$(git tag --sort=-version:refname | grep -v '^${getGitTag()}\$' | head -1 || true)"
+
+ gh release create '${getGitTag()}' \
+ --repo '${getGitAuthor()}/${getRepoName()}' \
+ --target '${getBuildBranch()}' \
+ --title '${getGitTag()}' \
+ --generate-notes \
+ \${PREV_TAG:+--notes-start-tag "\${PREV_TAG}"}
+ """
}
}
}
@@ -136,17 +160,35 @@ pipeline {
}
steps {
script {
- configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
- getMavenCommand()
- .withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : [])
- .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : [])
- .inDirectory(getRepoName())
- .skipTests(true)
- .withProperty('full')
- .withSettingsXmlFile(MAVEN_SETTINGS_FILE)
- .run('clean install')
+ dir(getRepoName()) {
+ configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+ def extraOpts = [
+ env.DROOLS_BUILD_MVN_OPTS,
+ env.BUILD_MVN_OPTS_CURRENT
+ ].findAll { it }.join(' ')
+
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ mvn -s "\${MAVEN_SETTINGS_FILE}" -B -ntp -fae \
+ -Dfull \
+ -DskipTests \
+ ${extraOpts} \
+ clean install
+ """
+ }
+
+ if (isNotTestingBuild()) {
+ sshagent(['drools-filemgmt']) {
+ sh """#!/usr/bin/env bash
+ set -euo pipefail
+ chmod +x script/release/upload_filemgmt.sh
+ ./script/release/upload_filemgmt.sh '${getProjectVersion()}'
+ """
+ }
+ } else {
+ echo 'No uploadFileMgmt due to testing build'
+ }
}
- uploadFileMgmt(getRepoName())
}
}
}
@@ -156,25 +198,23 @@ pipeline {
sendNotification()
}
cleanup {
- script {
- util.cleanNode()
- }
+ cleanWs()
}
}
}
void sendNotification() {
if (params.SEND_NOTIFICATION) {
- mailer.sendMarkdownTestSummaryNotification('Promote', "[${getBuildBranch()}] Drools", [env.DROOLS_CI_EMAIL_TO])
+ mail(
+ to: env.DROOLS_CI_EMAIL_TO,
+ subject: "[FAILURE] Promote [${getBuildBranch()}] Drools - Build ${BUILD_TAG}",
+ body: "Promote pipeline failed.\n\nBuild URL: ${BUILD_URL}"
+ )
} else {
echo 'No notification sent per configuration'
}
}
-//////////////////////////////////////////////////////////////////////////////
-// Deployment properties
-//////////////////////////////////////////////////////////////////////////////
-
void readDeployProperties() {
String deployUrl = params.DEPLOY_BUILD_URL
if (deployUrl != '') {
@@ -183,39 +223,21 @@ void readDeployProperties() {
}
sh "wget ${deployUrl}artifact/${PROPERTIES_FILE_NAME} -O ${PROPERTIES_FILE_NAME}"
deployProperties = readProperties file: PROPERTIES_FILE_NAME
- // echo all properties
echo deployProperties.collect { entry -> "${entry.key}=${entry.value}" }.join('\n')
}
}
-boolean hasDeployProperty(String key) {
- return deployProperties[key] != null
-}
-
String getDeployProperty(String key) {
- if (hasDeployProperty(key)) {
- return deployProperties[key]
- }
- return ''
-}
-
-String getParamOrDeployProperty(String paramKey, String deployPropertyKey) {
- if (params[paramKey] != '') {
- return params[paramKey]
- }
- return getDeployProperty(deployPropertyKey)
+ return deployProperties[key] != null ? deployProperties[key] : ''
}
-//////////////////////////////////////////////////////////////////////////////
-// Getter / Setter
-//////////////////////////////////////////////////////////////////////////////
-
String getRepoName() {
return env.REPO_NAME
}
+// PROJECT_VERSION param takes precedence; fall back to value from deploy properties.
String getProjectVersion() {
- return getParamOrDeployProperty('PROJECT_VERSION', 'project.version')
+ return params.PROJECT_VERSION ?: getDeployProperty('project.version')
}
// Approved RC tag to promote (e.g. 10.3.0-rc2). Mandatory, validated in Initialization.
@@ -248,56 +270,22 @@ String getDeployPrLink() {
return getDeployProperty("${getRepoName()}.pr.link")
}
-//////////////////////////////////////////////////////////////////////////////
-// Git
-//////////////////////////////////////////////////////////////////////////////
-
void checkoutRepo() {
deleteDir()
- checkout(githubscm.resolveRepository(getRepoName(), getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsId()))
- // need to manually checkout branch since on a detached branch after checkout command
+ checkout([$class: 'GitSCM',
+ branches: [[name: "*/${getBuildBranch()}"]],
+ userRemoteConfigs: [[
+ url: "https://github.com/${getGitAuthor()}/${getRepoName()}.git",
+ credentialsId: getGitAuthorCredsId()
+ ]]
+ ])
sh "git checkout ${getBuildBranch()}"
}
-void approveAndMergePR(String prLink) {
- if (prLink?.trim()) {
- githubscm.approvePR(prLink, getGitAuthorPushCredsId())
- githubscm.mergePR(prLink, getGitAuthorPushCredsId())
- }
-}
-
-void tagLatest() {
- if (getGitTag()) {
- githubscm.tagLocalAndRemoteRepository('origin', getGitTag(), getGitAuthorPushCredsId(), env.BUILD_TAG, true)
- }
-}
-
-MavenCommand getMavenCommand() {
- mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
- .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
- if (env.MAVEN_DEPENDENCIES_REPOSITORY) {
- mvnCmd.withDependencyRepositoryInSettings('deps-repo', env.MAVEN_DEPENDENCIES_REPOSITORY)
- }
- return mvnCmd
-}
-
-void uploadFileMgmt(String directory) {
- if (isNotTestingBuild()) {
- echo "upload binaries and docs for ${directory}"
- dir(directory) {
- sshagent(['drools-filemgmt']) {
- sh "script/release/upload_filemgmt.sh ${getProjectVersion()}"
- }
- }
- } else {
- echo 'No uploadFileMgmt due to testing build'
- }
-}
-
boolean isNotTestingBuild() {
return getGitAuthor() == 'apache'
}
boolean isMainStream() {
return env.DROOLS_STREAM == 'main'
-}
\ No newline at end of file
+}
diff --git a/.ci/jenkins/project/Jenkinsfile.103xplus.release b/.ci/jenkins/project/Jenkinsfile.103xplus.release
index 46887f161ef..8f75d946d0d 100644
--- a/.ci/jenkins/project/Jenkinsfile.103xplus.release
+++ b/.ci/jenkins/project/Jenkinsfile.103xplus.release
@@ -126,13 +126,22 @@ pipeline {
void sendNotification() {
if (params.SEND_NOTIFICATION) {
- mailer.sendMarkdownTestSummaryNotification('Release', "[${params.TAG_NAME}] Drools", [env.DROOLS_CI_EMAIL_TO])
+ mail(
+ to: env.DROOLS_CI_EMAIL_TO,
+ subject: "[${params.TAG_NAME}] Drools Release",
+ body: "Release pipeline finished.\n\nBuild URL: ${BUILD_URL}"
+ )
} else {
echo 'No notification sent per configuration'
}
}
void sendErrorNotification() {
- sendNotification()
- mailer.sendMarkdownErrorNotification('Release', "[${params.TAG_NAME}] Drools", [env.DROOLS_CI_EMAIL_TO])
+ if (params.SEND_NOTIFICATION) {
+ mail(
+ to: env.DROOLS_CI_EMAIL_TO,
+ subject: "[FAILURE] [${params.TAG_NAME}] Drools Release",
+ body: "Release pipeline failed.\n\nBuild URL: ${BUILD_URL}"
+ )
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org