SAID Med Bechir
SAID Med Bechir

Reputation: 109

How to get hg branch name in jenkins file

I'm working with jenkins file pipeline and i want to show the hg branch name in the current build name ( instead of the build number ). I tried with this code: currentBuild.displayName = "${BRANCH_NAME}" but it returned null. Is there other solution ?

Upvotes: 3

Views: 202

Answers (1)

S.Spieker
S.Spieker

Reputation: 7385

There is another environment variable for mercurial: ${MERCURIAL_REVISION_BRANCH}. This should not be null in case it is a branch being built. The feature got inserted by this pull request

Upvotes: 4

Related Questions