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 <[email protected]> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/55df0cca-759d-41f5-abc6-6c16370c1f63%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/55df0cca-759d-41f5-abc6-6c16370c1f63%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAJuMdDM3sDNrmxfy-9-oesCieLd26mjK%2B1VD5abA%3D%3D98NdkX7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.