From 2ea5908d7197fd2a895e1992920db2d7cfdf64d7 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 16 Feb 2018 14:55:55 -0500 Subject: [PATCH] Add triggers to jenkins-cfg job Allows the job to run on a timed trigger as well as on patch merged events. Default timed trigger is run @daily. Change-Id: I54b04e7814718816fe221a33d80aa1c1574095d7 Signed-off-by: Thanh Ha --- docs/jjb/lf-ci-jobs.rst | 2 ++ jjb/lf-ci-jobs.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index af5ad74d..19de22d1 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -143,6 +143,8 @@ The format for this file is ``KEY=value`` for example:: :Optional parameters: + :branch: Git branch to build against. (default: master) + :cron: How often to run the job on a cron schedule. (default: @daily) :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT) :jenkins-silos: Space separated list of Jenkins silos to update configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 8e3d4d9e..558d3858 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -273,9 +273,19 @@ ###################### branch: master + cron: '@daily' git-url: '$GIT_URL/$GERRIT_PROJECT' jenkins-silos: production sandbox + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + gerrit_trigger_file_paths: + - compare-type: ANT + pattern: 'jenkins-config/**' + ##################### # Job Configuration # ##################### @@ -324,6 +334,19 @@ choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + - timed: '{obj:cron}' + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_merge_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' + - job-template: name: '{project-name}-jenkins-cfg-merge' id: github-jenkins-cfg-merge @@ -342,6 +365,21 @@ choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + - timed: '{obj:cron}' + - github + - pollscm: + cron: '' + - lf-infra-github-pr-trigger: + trigger-phrase: '^remerge$' + only-trigger-phrase: true + status-context: 'Jenkins CFG Merge' + permit-all: false + github-hooks: true + github-org: '{github-org}' + github_pr_whitelist: '{obj:github_pr_whitelist}' + github_pr_admin_list: '{obj:github_pr_admin_list}' + ################## # JJB DEPLOY JOB # -- 2.16.6