Continuous integration creates a build loop

74 views
Skip to first unread message

Eldad Cohen

unread,
Feb 12, 2019, 8:15:32 AM2/12/19
to Jenkins Users

Hi,


I am using Multibranch Job.

I have a Webhook for my repository in gilab which is triggered when there is a push to dev branch and then webhook starts the build in Jenkins

At the end of build process, I created and updated chaneglog file and push it to dev branch again which would trigger the webhook again and make a loop of builds in Jenkins.

Any suggestions ?


Thanks


Steven Foster

unread,
Feb 12, 2019, 10:24:22 AM2/12/19
to Jenkins Users
I'm not sure what's available for Gitlab, but some other SCMs have a plugin that allows commits by certain authors be skipped/ignored.
If there is no such plugin for Gitlab, it might be easy enough to make one or contribute a gitlab implementation to an existing one.

Tom Duerr

unread,
Feb 13, 2019, 11:13:13 AM2/13/19
to jenkins...@googlegroups.com
Hi,

It's not the cleanest approach but we get around a similar issue by adding a specific string into the commit message( like "No Build")
then in the Jenkinsfile we look for that string and exit if we find it.

Tom

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2ce983bc-fb40-4b3a-9fd8-719040d32e4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eldad Cohen

unread,
Feb 14, 2019, 5:29:53 AM2/14/19
to Jenkins Users
Thanks on the tip
Can you please elaborate how did you exit ?
 

Tom Duerr

unread,
Feb 14, 2019, 4:33:17 PM2/14/19
to jenkins...@googlegroups.com
Hi,
We use a when clause to run the stage or not based on finding
a specific string in the commit message
stage('Publish') {
// if we dont find SKIP_PUBLISH in git log
// then we proceed with push
// note, we're checking the status of the grep command
// not the output. grep status will be 0 if we find the
// string and 1 if we dont find
when {
branch 'master'
expression {
grepStatus = sh(returnStatus: true,
script: 'git log -1 | grep SKIP_PUBLISH')
return 1 == grepStatus
}
    }

On Thu, Feb 14, 2019 at 2:29 AM Eldad Cohen <eldadc...@gmail.com> wrote:
Thanks on the tip
Can you please elaborate how did you exit ?
 

--
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-use...@googlegroups.com.

Eldad Cohen

unread,
Feb 17, 2019, 5:53:29 AM2/17/19
to Jenkins Users
Thanks a lot 
Reply all
Reply to author
Forward
0 new messages