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

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jenkins-lib.git


The following commit(s) were added to refs/heads/master by this push:
     new ccb0b9c  Deploy artifacts from branch defined in branchesToNotify
ccb0b9c is described below

commit ccb0b9cd4027ba89a97cb221d6691665d008a28e
Author: Slawomir Jaranowski <s.jaranow...@gmail.com>
AuthorDate: Thu May 1 12:00:36 2025 +0200

    Deploy artifacts from branch defined in branchesToNotify
---
 README.adoc                     | 6 +++---
 vars/asfMavenTlpStdBuild.groovy | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.adoc b/README.adoc
index 3189c4b..fc3723b 100644
--- a/README.adoc
+++ b/README.adoc
@@ -6,7 +6,7 @@ This repository contains the Jenkins shared libraries that 
define the standard b
 
 ==== Accepted parameters:
 - `os`: array of possible os to build projects (default: `['linux']`)
-- `jdks`: array of jdks used for the build (default: `['8','11','17']`)
+- `jdks`: array of jdks used for the build (default: `['8','11','17', '21']`)
 - `maven`: array of maven versions used for build (default: `['3.6.x', 
'3.9.x']`)
 - `siteJdk`: array of jdks used for the site build (default: `[11']`)
 - `siteMvn`: jdk used to build the site (default: `3.9.x`)
@@ -22,10 +22,10 @@ asfMavenTlpPlgnBuild(jdks:[ "8", "11" ], maven: ["3.8.x"])
 
 ==== Accepted parameters:
 - `os`: array of possible os to build projects (default: `['linux']`)
-- `jdks`: array of jdks used for the build (default: `['8','11','17']`)
+- `jdks`: array of jdks used for the build (default: `['8','11','17', '21']`)
 - `maven`: maven versions used for build (default: `3.9.x`)
 - `tmpWs`: boolean to shorten working directory on windows platform
-- `branchesToNotify`: array of branches to send notifications of the build 
(default: `['master', 'main']`)
+- `branchesToNotify`: array of branches to send notifications of the build and 
deploy artifacts (default: `['master', 'main']`)
 
 Example to use a specific set of jdks and maven core
 ```
diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 357f2c4..5367e98 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -24,7 +24,7 @@ def call(Map params = [:]) {
   def branchesToNotify = params.containsKey("branchesToNotify") ? 
params.branchesToNotify : ['master', 'main']
   try {
     def buildProperties = []
-    if (env.BRANCH_NAME == 'master') {
+    if (branchesToNotify.contains(env.BRANCH_NAME)) {
       // set build retention time first
       buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10')))
       // ensure a build is done every month
@@ -69,7 +69,7 @@ def call(Map params = [:]) {
         }
         cmd += 'clean'
         cmd += mavenArgs
-        if (env.BRANCH_NAME == 'master' && jdk == '21' && os == 'linux' ) {
+        if (branchesToNotify.contains(env.BRANCH_NAME) && jdk == '21' && os == 
'linux' ) {
           cmd += 'deploy'
         } else {
           cmd += 'verify -Dpgpverify.skip'

Reply via email to