Hi, $WORKSPACE on slave node is not available for scripts doing ssh (it is ok on master)
My process must ssh to servers and save files in Jenkins workspace, since I setup slave nodes in Jenkins I am unable to access workspace within ssh. Any idea how to share the workspace on slaves sub-process? Thanks in advance for help Philippe Sample project, build: Execute shell: touch $WORKSPACE/beforesshing.txt ; ssh <my server> "setenv WORKSPACE $WORKSPACE ; touch $WORKSPACE/ssh.txt" && echo "PASS ssh" || echo "FAIL ssh" ; touch $WORKSPACE/aftersshing.txt ; Restrict where this project can be run: NO Console output: ==== master SUCCESS ==== Started by user build Building on master in workspace /home/build/.jenkins/workspace/SLAVE-disable-WS-test [SLAVE-disable-WS-test] $ /bin/sh -xe /tmp/hudson3043285578570569778.sh + touch /home/build/.jenkins/workspace/SLAVE-disable-WS-test/beforesshing.txt + ssh ies-ams-bld-03 'setenv WORKSPACE /home/build/.jenkins/workspace/SLAVE-disable-WS-test ; touch /home/build/.jenkins/workspace/SLAVE-disable-WS-test/ssh.txt' + echo 'PASS ssh' PASS ssh + touch /home/build/.jenkins/workspace/SLAVE-disable-WS-test/aftersshing.txt Notifying upstream projects of job completion Finished: SUCCESS ==== slave FAILURE ==== Started by user build Building remotely on ies-ams-bld-03 in workspace /var/tmp/jenkins/workspace/SLAVE-disable-WS-test [SLAVE-disable-WS-test] $ /bin/sh -xe /tmp/hudson6249211265516385403.sh + touch /var/tmp/jenkins/workspace/SLAVE-disable-WS-test/beforesshing.txt + ssh ies-ams-bld-03 'setenv WORKSPACE /var/tmp/jenkins/workspace/SLAVE-disable-WS-test ; touch /var/tmp/jenkins/workspace/SLAVE-disable-WS-test/ssh.txt' touch: cannot touch `/var/tmp/jenkins/workspace/SLAVE-disable-WS-test/ssh.txt': No such file or directory + echo 'FAIL ssh' FAIL ssh + touch /var/tmp/jenkins/workspace/SLAVE-disable-WS-test/aftersshing.txt Notifying upstream projects of job completion Finished: SUCCESS -- 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-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.