Parameters are not handed over to a Windows slave when executing a ssh step.
On windows we have cygwin installed, the ssh commands are executed as wanted, just the parameter values are missing.
It doesn't matter what kind of parameters, of the parametrized build or in the job configured env variables.
I have configured a test job with the parameters
tags (Extended Choice Parameters), value @foo
bool (Boolean Parameter), set to true
param (Environment variable), value bar
First step is ssh, second step is windows batch command
echo ${tags}
echo ${bool}
echo ${param}
echo %tags%
echo %bool%
echo %param%
in the log it becomes obvious that the parameters are empty:
Started by user Administrator
Building remotely on win-server (windows) in workspace C:\jenkins\workspace\testWindowsSlave
[testWindowsSlave] $ sh -xe c:\DOCUME~1\SSHD_S~1\LOCALS~1\Temp\hudson5465246172464034605.sh
+ echo
+ echo
+ echo
[testWindowsSlave] $ cmd /c call c:\DOCUME~1\SSHD_S~1\LOCALS~1\Temp\hudson4192714334924793300.bat
C:\jenkins\workspace\testWindowsSlave>echo @foo
@foo
C:\jenkins\workspace\testWindowsSlave>echo true
true
C:\jenkins\workspace\testWindowsSlave>echo bar
bar
C:\jenkins\workspace\testWindowsSlave>exit 0
Finished: SUCCESS
Configuring a windows batch step is a workaround, but e.g. for multi-config projects an unneccessary extra (conditional) configuration
|