Hi all,
Our releases in Jenkins take around 1h to build. We have release day and time, let say Mon from 3PM to 8PM, if any PR merges in this time window, build fails and need to be started again. I need to prevent any merges to develop and release branches during this time window. Any ideas how to achieve that?
Thank you,
Peter
Write a one-line merge check in Groovy for ScriptRunner!
The script itself should just get the current system time and test if it is not within the unwanted period. We develop an app that heavily relies on hooks and merge checks, and in our experience merge checks are absolutely reliable.
Searching for "jenkins prevent a merge" also returns some interesting results.
Hyrum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peter,
I did a Google search for, "jenkins automatically build on failure" and found an interesting suggestion on Stack Overflow for a Jenkins plugin. See the following links for further details:
https://plugins.jenkins.io/downstream-ext/
It may pay to check out other plugins for Jenkins.
An alternative would be to use a Jira scripting tool as found on the Atlassian Marketplace such as Scriptrunner, JMWE or Power Scripts. Perhaps there are some Jenkins REST endpoints you could use in a script to restart the build depending on your use case. However, in practice, I would prefer to do this in Jenkins. An error handler is always better than a scheduler.
Regards,
Hyrum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.