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

olamy 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 50b9008  deploy on branche names matching maven-.*-3\.x
50b9008 is described below

commit 50b9008659b4da919498f5fd1f4da86d4efe3186
Author: Olivier Lamy <[email protected]>
AuthorDate: Sun Mar 1 21:27:55 2026 +1000

    deploy on branche names matching maven-.*-3\.x
    
    Signed-off-by: Olivier Lamy <[email protected]>
---
 vars/asfMavenTlpPlgnBuild.groovy | 7 ++++---
 vars/asfMavenTlpStdBuild.groovy  | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/vars/asfMavenTlpPlgnBuild.groovy b/vars/asfMavenTlpPlgnBuild.groovy
index 7182a4b..4e18098 100644
--- a/vars/asfMavenTlpPlgnBuild.groovy
+++ b/vars/asfMavenTlpPlgnBuild.groovy
@@ -22,10 +22,11 @@
 def call(Map params = [:]) {
   Map taskContext = [:]
   def branchesToNotify = params.containsKey("branchesToNotify") ? 
params.branchesToNotify : ['master', 'main']
+  def shouldDeploy = { branchesToNotify.contains(env.BRANCH_NAME) || 
env.BRANCH_NAME ==~ /maven-.*-3\.x/ }
 
   try {
     def buildProperties = []
-    if (env.BRANCH_NAME == 'master') {
+    if (shouldDeploy()) {
       // set build retention time first
       buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10')))
       // ensure a build is done every month
@@ -102,7 +103,7 @@ def call(Map params = [:]) {
     if (taskContext.failingFast != null) {
       echo "***** FAST FAILURE *****\n\nFast failure triggered by 
${taskContext.failingFast}\n\n***** FAST FAILURE *****"
     }
-    if (branchesToNotify.contains(env.BRANCH_NAME)) {
+    if (shouldDeploy()) {
       stage("Notifications") {
         jenkinsNotify()
       }
@@ -136,7 +137,7 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, 
taskContext )
 
   if (plan == 'build') {
       cmd += 'clean'
-      if (env.BRANCH_NAME == 'master' && jdk == '21' && maven == '3.9.x' && os 
== 'linux' ) {
+      if (shouldDeploy() && jdk == '21' && maven == '3.9.x' && os == 'linux' ) 
{
         cmd += 'deploy'
       } else {
         cmd += 'verify -Dpgpverify.skip'      
diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 5367e98..99e73d2 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -22,9 +22,10 @@
 def call(Map params = [:]) {
   def failingFast = null
   def branchesToNotify = params.containsKey("branchesToNotify") ? 
params.branchesToNotify : ['master', 'main']
+  def shouldDeploy = { branchesToNotify.contains(env.BRANCH_NAME) || 
env.BRANCH_NAME ==~ /maven-.*-3\.x/ }
   try {
     def buildProperties = []
-    if (branchesToNotify.contains(env.BRANCH_NAME)) {
+    if (shouldDeploy()) {
       // 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 +70,7 @@ def call(Map params = [:]) {
         }
         cmd += 'clean'
         cmd += mavenArgs
-        if (branchesToNotify.contains(env.BRANCH_NAME) && jdk == '21' && os == 
'linux' ) {
+        if (shouldDeploy() && jdk == '21' && os == 'linux' ) {
           cmd += 'deploy'
         } else {
           cmd += 'verify -Dpgpverify.skip'
@@ -170,7 +171,7 @@ def call(Map params = [:]) {
     if (failingFast != null) {
       echo "***** FAST FAILURE *****\n\nFast failure triggered by 
${failingFast}\n\n***** FAST FAILURE *****"
     }
-    if (branchesToNotify.contains(env.BRANCH_NAME)) {
+    if (shouldDeploy()) {
       stage("Notifications") {
         jenkinsNotify()
       }

Reply via email to