Variable substitution with Publish Over SSH plugin

10 views
Skip to first unread message

Olivier Dupré

unread,
Aug 30, 2017, 2:38:44 PM8/30/17
to jenkins...@googlegroups.com
Hi there,

I'm facing a problem with variable substitution with "Publish over SSH" plugin.

I'd like to update "$PATH" before running my commands.
But... I just can't manipulate it through a script on my remote machine.

In my .profile script, I'm updating PATH:
cat .profile
export PATH=$PATH:xxx:yyy:zzz
echo $PATH

But when I'm sourcing my .profile from Publisher plugin, it just does not update the PATH variable.

So, I'm running this:
echo PATH "$PATH";
eval  echo  'PATH $'PATH;
source ~/.profile.45S
eval  echo  'PATH $'PATH;

And have the followign result:
  1. $PATH from my Jenkins slave //what I'm expecting here
  2. $PATH from my remote machine //also what I'm expecting here
  3. $PATH from my remote machine, with xxx:yyy:zzz concatenated //again, what I'm expecting here
  4. The same $PATH as in step 2, while I'm expecting the same as previous step.

Do you have any idea of why step 4 produces same result as step 2, while I'm expecting same result as step 3 since I experted the variable and did not change it between the 2 echo commands...

Cheers,
Olivier
Reply all
Reply to author
Forward
0 new messages