Pipeline: What do I have to do to get the scm to inject environment variables?

17 views
Skip to first unread message

Jonathan Hodgson

unread,
Nov 11, 2016, 9:33:32 AM11/11/16
to Jenkins Users
Hi,

I apologize if this is basic stuff

I have a pipeline job with a jenkinsfile, as a result when the pipeline runs there is an scm object, 

hudson.plugins.mercurial.MercurialSCM

I notice in the source code that there is

public void buildEnvVars(AbstractBuild<?,?> build, Map<String, String> env)

Which injects MERSURIAL_REVISION, MERCURIAL_REVISION_BRANCH etc.

Now a brief google gives me the impression that that method should be called automatically by AbstractBuild.

But if I do

sh "set"

none of those Mercurial environment are visible

So do I have to do something explicit in order to gain access to those values?

thanks

Jon
Reply all
Reply to author
Forward
0 new messages