Triggers define what causes a jenkins job to start buliding.
Macro: | trigger |
---|---|
Entry Point: | jenkins_jobs.triggers |
Example:
job:
name: test_job
triggers:
- timed: '@daily'
Trigger on a Gerrit event. Requires the Jenkins Gerrit Trigger Plugin version >= 2.6.0.
Parameters: |
|
---|
You may select one or more gerrit events upon which to trigger. You must also supply at least one project and branch, optionally more. If you select the comment-added trigger, you should alse indicate which approval category and value you want to trigger the job.
Until version 0.4.0 of Jenkins Job Builder, camelCase keys were used to configure Gerrit Trigger Plugin, instead of hyphenated-keys. While still supported, camedCase keys are deprecated and should not be used.
Example:
triggers:
- gerrit:
trigger-on-comment-added-event: true
trigger-approval-category: 'APRV'
trigger-approval-value: 1
projects:
- project-compare-type: 'PLAIN'
project-pattern: 'test-project'
branch-compare-type: 'ANT'
branch-pattern: '**'
file-paths:
- compare-type: ANT
pattern: subdirectory/**
skip-vote:
successful: true
failed: true
unstable: true
notbuilt: true
Trigger a job when github repository is pushed to Requires the Jenkins GitHub Plugin.
Example:
triggers:
- github
Build pull requests in github and report results Requires the Jenkins GitHub Pull Request Builder Plugin.
Parameters: |
|
---|
Example:
triggers:
- github-pull-request:
admin-list:
- user1
- user2
cron: * * * * *
white-list:
- user3
- user4
org-list:
- org1
- org2
Poll the SCM to determine if there has been a change.
Parameter : | the polling interval (cron syntax) |
---|
Example:
triggers:
- pollscm: "\*/15 * * * \*"
Trigger builds at certain times.
Parameter : | when to run the job (cron syntax) |
---|
Example:
triggers:
- timed: "@midnight"