looking for some solutions? You are welcome.

SOLVED: Branch specifier regex in Jenkins scripted pipeline

Ashley:

Suppose i want to define pipeline for different branches under same scripted pipeline, how to define the regex for certain pattern of branches. Say for example :-

if(env.BRANCH_NAME ==~ /release.*/){
         stage("Deploy"){
                echo 'Deployed release to QA'
         }

Here i want to define that regex in such a way for any branch of the pattern

*release*

(meaning any branch with release string in it). How to achieve that?

And similarly how to achieve something like :-

if the branch is anything but develop, master, release(pattern).



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent