I have everything set in controller branch and I need to create new branches from it for which I would like to trigger my job. I define “filter branch by name with regex” ^release/2034.(\d.\d) so the branch name release/2034.3.3 and release/2034.3.4 should match!
I do these steps:
– set everything in controller
– create new Jenkins configuration with regex match for branch names ^release/2034.(\d.\d)
– in git Bitbucket create new branch release/2034.3.3 — NOTHING HAPPENS although I want my job for which I did configuration to be triggered!!!
— now I go to configuration and click Save! Jenkins now see that branch now and it starts the build - that is good but why it didn’t processes it at the first place? Jenkins event for this job is as I can see “Branch indexing”
>Started
Starting branch indexing…*
Checking branch release/2034.3.3 from ~e/private
‘Jenkinsfile_release.jenkins’ found*
- Met criteria*
Scheduled build for branch: release/2034.3.3
— now I still do not change anything on the controller and again create new branch from controller in Bitbucket. Branch name this time is release/2034.3.4. It is being processed which is GOOD! Jenkins event for this is:
"Branch event "
[Fri Apr 15 07:19:21 EDT 2022] Received com.cloudbees.jenkins.plugins.bitbucket.hooks.PushHookProcessor$1 CREATED event from 20.75.27.78 ⇒ http://jenkins.domain:8080/cap/bitbucket-scmsource-hook/notify with timestamp Fri Apr 15 07:19:16 EDT 2022 Connecting to [https://bitbucket.domain]using 2013380-b107 Repository type: Git Looking up ~e/private for branches Checking branch release/2034.3.4 from ~e/private ‘Jenkinsfile_release.jenkins’ found Met criteria Scheduled build for branch: release/2034.3.4
So why my first build job for release 2033.3.3 hasn’t be run immediately but I had to go to Configuration and click SAVE once again for configuration which already existed when my branch was created? After I saved it the build was executed run.
But for my second branch release 2033.3.4 the build job triggered like expected without any manual intervention, which is the desired state. For every new branch that gets created and matches the regex I want to trigger build job.
Could you please help me with this? I am not sure why the first build job is stuck while I do not re-click Save in configuration after the branch is created.
I am sending print screens of configuration if that can help.