| Steps to reproduce: 1. Add a webhook to a GitHub repo which sends the following events to Jenkins: Pushes, Branch or tag creation, Releases. 2. Create two "Pipeline" jobs in Jenkins, both referencing the same GitHub repo. The jobs execute a Declarative Pipeline Jenkinsfile script.
NOTE: JJB is used to create the jobs (jobs are not copied).
Settings for job 1 (master branch job): Do not allow concurrent builds GitHub hook trigger for GITScm polling Pipeline script from SCM: Git Repo ID: origin Refspec: +refs/heads/:refs/remotes/origin/ Branch Specifier: refs/heads/master Additional Behaviors: Wipe out repository & force clone Lightweight checkout: false
Settings for job 2 (tag job): Do not allow concurrent builds GitHub hook trigger for GITScm polling Pipeline script from SCM: Git Repo ID: origin Refspec: +refs/tags/:refs/remotes/origin/tags/ Branch Specifier: /tags/ Additional Behaviors: Wipe out repository & force clone Lightweight checkout: false
3. When commits are merged to the master branch of the repo, the webhook fires and Job 1 executes. 4. When new releases (tags) are published, the webhook fires and Job 2 executes for the most recent (new) tag. (Things have been running smoothly for me with this type of setup for a couple years.) 5. Occasionally there is a situation with jobs configured like job 2, specifically:
|