Jenkins pushes on our Git repository: how to prevent infinite loops?

416 views
Skip to first unread message

Jonathan Ballet

unread,
Nov 25, 2016, 7:23:23 AM11/25/16
to Jenkins Users
Hi,

We have several builds which are triggered by push on the remote Git repositories associated. For these builds, we are using the Pipeline plugin with the in-repository Jenkinsfile.

After the build has been successfully completed, we usually deploy the relevant artifact produced by first bumping the version number, editing our deployment scripts to deploy this new version then deploy it. Jenkins finally commit everything and pushes this back to the Git repository ...

... and if don't do anything, infinite loops ensue :)

We are using an adapted version of the "CI-Skip" plugin (which marks a build has "NOT_BUILT" if the commit messages which triggered the build contain a specific pattern) which works OK, except that:

* our build history has lot of interlaced green/gray builds
* the last build is always a "NOT_BUILT" build, which makes it slightly harder to see the "real" build result (even if it should be green, anyway)
* last but not least, Jenkins is doing useless job because it still starts the whole Pipeline machinery just to stop after the initial scm checkout step.

See attached screenshot.

How could we make a better way to skip/filter builds based on what has been pushed on our Git repositories?


Thanks!

 Jonathan
jenkins-skip.png

Baptiste Mathus

unread,
Nov 26, 2016, 9:20:39 AM11/26/16
to jenkins...@googlegroups.com
How do you handle the pushes Git server -> Jenkins? Maybe you could just skip pushes based on commit pattern?

Alternatively, more hacky, feels like, make those pushes trigger a dummy upstream job that will or will not trigger the pipeline. 

I think the first solution is probably the cleanest. I'm curious how this case is handled by other tools in the field.

Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/04e90032-c00d-4aef-ae88-01b7c83a3a1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages