Triggers

Triggers define what causes a jenkins job to start buliding.

Component: triggers
Macro:trigger
Entry Point:jenkins_jobs.triggers

Example:

job:
  name: test_job

  triggers:
    - timed: '@daily'
gerrit

Trigger on a Gerrit event. Requires the Jenkins Gerrit Trigger Plugin.

Parameters:
  • triggerOnPatchsetUploadedEvent (bool) – Trigger on patchset upload
  • triggerOnChangeMergedEvent (bool) – Trigger on change merged
  • triggerOnCommentAddedEvent (bool) – Trigger on comment added
  • triggerOnRefUpdatedEvent (bool) – Trigger on ref-updated
  • triggerApprovalCategory (str) – Approval category for comment added
  • triggerApprovalValue (int) – Approval value for comment added
  • overrideVotes (bool) – Override default vote values
  • gerritBuildSuccessfulVerifiedValue (int) – Successful ‘’Verified’’ value
  • gerritBuildFailedVerifiedValue (int) – Failed ‘’Verified’’ value
  • failureMessage (str) – Message to leave on failure
  • projects (list) –

    list of projects to match

    Project:
    • projectCompareType (str) – ‘’PLAIN’’ or ‘’ANT’‘
    • projectPattern (str) – Project name pattern to match
    • branchComprareType (str) – ‘’PLAIN’’ or ‘’ANT’‘
    • branchPattern (‘str’) – Branch name pattern to match

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.

Example:

triggers:
  - gerrit:
      triggerOnCommentAddedEvent: true
      triggerApprovalCategory: 'APRV'
      triggerApprovalValue: 1
      projects:
        - projectCompareType: 'PLAIN'
          projectPattern: 'test-project'
          branchCompareType: 'ANT'
          branchPattern: '**'
pollscm

Poll the SCM to determine if there has been a change.

Parameter :the polling interval (cron syntax)

Example:

triggers:
  - pollscm: "\*/15 * * * \*"
timed

Trigger builds at certain times.

Parameter :when to run the job (cron syntax)

Example:

triggers:
  - timed: "@midnight"

Previous topic

SCM

Next topic

Wrappers

This Page