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

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

commit bebaa006d15990129076b489884a1eb3bacc35f3
Author: Arnaud Héritier <aherit...@apache.org>
AuthorDate: Mon Apr 12 21:41:32 2021 +0200

    [chore] Build master branches every month
---
 vars/asfMavenTlpPlgnBuild.groovy | 12 +++++++-----
 vars/asfMavenTlpStdBuild.groovy  | 12 +++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/vars/asfMavenTlpPlgnBuild.groovy b/vars/asfMavenTlpPlgnBuild.groovy
index 5ff67f7..894b55c 100644
--- a/vars/asfMavenTlpPlgnBuild.groovy
+++ b/vars/asfMavenTlpPlgnBuild.groovy
@@ -22,14 +22,16 @@
 def call(Map params = [:]) {
   Map taskContext = [:]
   try {
-    // set build retention time first
-    def buildRetention
+    def buildProperties = []
     if (env.BRANCH_NAME == 'master') {
-      buildRetention = buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10'))
+      // set build retention time first
+      buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10')))
+      // ensure a build is done every month
+      buildProperties.add(pipelineTriggers([cron('@monthly')]))
     } else {
-      buildRetention = buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '2', daysToKeepStr: '7', numToKeepStr: '3'))
+      buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '2', daysToKeepStr: '7', numToKeepStr: '3')))
     }
-    properties([buildRetention])
+    properties(buildProperties)
 
     // now determine the matrix of parallel builds
     def oses = params.containsKey('os') ? params.os : ['linux', 'windows']
diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 314ed24..e8dd547 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -22,14 +22,16 @@
 def call(Map params = [:]) {
   def failingFast = null
   try {
-    // set build retention time first
-    def buildRetention
+    def buildProperties = []
     if (env.BRANCH_NAME == 'master') {
-      buildRetention = buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10'))
+      // set build retention time first
+      buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '5', daysToKeepStr: '15', numToKeepStr: '10')))
+      // ensure a build is done every month
+      buildProperties.add(pipelineTriggers([cron('@monthly')]))
     } else {
-      buildRetention = buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '2', daysToKeepStr: '7', numToKeepStr: '3'))
+      buildProperties.add(buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '2', daysToKeepStr: '7', numToKeepStr: '3')))
     }
-    properties([buildRetention])
+    properties(buildProperties)
 
     // now determine the matrix of parallel builds
     def oses = params.containsKey('os') ? params.os : ['linux', 'windows']

Reply via email to