Proper way to set job PATH with OpenStack Job Builder

20 views
Skip to first unread message

KARR, DAVID

unread,
Apr 20, 2015, 11:43:56 AM4/20/15
to jenkins...@googlegroups.com
I have a question or two about proper job definition using the "Job Builder" facility that was developed for OpenStack, which is defined at: http://ci.openstack.org/jenkins-job-builder/ .

I would ask about this in the OpenStack community, but I'd like to hear what the Jenkins community might say about this.

Specifically, I'd like to be clear on the proper way to set the correct environment (PATH) for a build job that runs on a JNLP-connected slave.

I was first under what I believe was a mistaken impression, which was that the PATH for a build job is taken from the PATH of the script that runs "java -jar slave.jar". I'm fairly certain that's wrong, but I'm having trouble finding a straight answer on the proper strategy for this.

Richard Bywater

unread,
Apr 20, 2015, 4:33:57 PM4/20/15
to jenkins...@googlegroups.com
The job should AFAIK inherit the PATH of the environment that is calling Java to start the slave.

If you can describe what issue you are seeing then we may be able to assist?

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/B8D164BED956C5439875951895CB4B22283E0675%40CAFRFD1MSGUSRIA.ITServices.sbc.com.
For more options, visit https://groups.google.com/d/optout.

KARR, DAVID

unread,
Apr 20, 2015, 4:57:09 PM4/20/15
to jenkins...@googlegroups.com

I print the PATH inside the subshell, just before running “java jar slave.jar ...”, and it’s correct.  The build job, when it does not manually set the PATH, gets an incorrect PATH, so the build job fails.  When the build job is changed to manually set the PATH, it works fine.

 

I know that subprocesses inherit the environment of the parent, but I believe that build jobs run on a jenkins slave do not inherit the environment of the process that ran the slave.  I believe that jobs need to specify their own PATH, or perhaps get a PATH setting for the node in the Jenkins master (which is not the same as the PATH used to run the slave).  I believe this makes more logical sense than setting the environment for all the build jobs on a slave by setting the environment of the process that runs the slave.

 

Reply all
Reply to author
Forward
0 new messages