PATH environment not set in launcher in SimpleBuildStep

26 views
Skip to first unread message

Christian Pontesegger

unread,
Jan 28, 2021, 1:41:37 AM1/28/21
to Jenkins Developers
Hi everyone,

I am trying to write a simple plugin that launches an Eclipse instance
on a slave. Therefore java needs to be registered in the PATH
environment variable.

My plugin looks like this:

MyStep extends Builder implements SimpleBuildStep {
...
  perform(Run<?,?> run, FilePath workspace, Launcher launcher,
TaskListener listener) {

    launcher.launch.cmds(...)
  }
}

Problem is that the Environment variables defined in the slave
Configuration/Node Properties do not seem to be available to my launch.

I tried to add envs from run.getEnvironment(listener) but that gives me
only the env variables globally defined in Jenkins, not the ones from
the specific slave.

How can I access the slave environment variables and make them
available to my launch?

I am using Jenkins 2.249.1

thanks a lot
Christian

Jesse Glick

unread,
Jan 28, 2021, 7:08:48 PM1/28/21
to Jenkins Dev
You need to switch to overriding the new `perform` overload. JENKINS-29144
Reply all
Reply to author
Forward
0 new messages