Declarative Pipeline - how to get scm variables

20 views
Skip to first unread message

nirav

unread,
Sep 20, 2018, 9:48:44 AM9/20/18
to Jenkins Users
I have few problems locating scm related variables:

In scripted pipeline I used this:


            scmVars = checkout scm
            echo "scmVars: ${scmVars}"
            echo "tagName: ${env.TAG_NAME}"
            echo "branchName: ${env.BRANCH_NAME}"
            echo "changeTarget: ${env.CHANGE_TARGET}"

Since in declarative one I dont need to checkout, how do I get hang of variables?

env.TAG_NAME, env.BRANCH_NAME all coming up null.

is see 'branch' is used in conditional 'when' expression 
     when {
                branch 'master'
            }
but how many such variables are available ?

Reply all
Reply to author
Forward
0 new messages