From bc80d1d2ea640dfedb2dcfa5097c5ff275c36b71 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Mon, 29 Jan 2018 12:51:21 -0500 Subject: [PATCH] Refactor macro/template cron param Be consistent with cron parameter: define in macro, use in template. Never hard-code a trigger in a job template. Document the parameters in the RST file. Change-Id: I70a1deefd23bc9498f6c6013fb8751298dec7f53 Signed-off-by: Christopher Lott (cl778h) --- docs/jjb/lf-maven-jobs.rst | 8 ++++++++ jjb/lf-maven-jobs.yaml | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index d1acc8de..29c565ef 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -222,6 +222,10 @@ This job uses the following strategy to deploy jobs to Nexus: :branch: Git branch to fetch for the build. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in seconds before aborting build. (default: 60) + :cron: Cron schedule when to trigger the job. This parameter also + supports multiline input via YAML pipe | character in cases where + one may want to provide more than 1 cron timer. (default: 'H H * * 0' + to run weekly) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for @@ -313,6 +317,10 @@ interest in that kind of support. :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in seconds before aborting build. (default: 60) + :cron: Cron schedule when to trigger the job. This parameter also + supports multiline input via YAML pipe | character in cases where + one may want to provide more than 1 cron timer. (default: 'H H * * 6' + to run weekly) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 7e55dbe5..609c592c 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -468,7 +468,7 @@ branch: master build-days-to-keep: 30 # 30 days in case we need to troubleshoot build-timeout: 60 - cron: '' + cron: 'H H * * 0' # push fresh snapshot weekly git-url: '$GIT_URL/$PROJECT' java-version: openjdk8 mvn-global-settings: global-settings @@ -539,7 +539,7 @@ choosing-strategy: default triggers: - - timed: 'H H * * 0' + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_merge_triggers}' @@ -709,6 +709,7 @@ branch: master # Sonar should always be run on master branch build-days-to-keep: 7 build-timeout: 60 + cron: 'H H * * 6' # run weekly git-url: '$GIT_URL/$PROJECT' java-version: openjdk8 mvn-global-settings: global-settings @@ -753,7 +754,7 @@ can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar". triggers: - - timed: 'H H * * 6' + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_sonar_triggers}' -- 2.16.6