Espector Espector - 4 months ago 81
Bash Question

Jenkins - Passing variable password to external shell

I am using the BUILD STEP "Execute shell script on remote host" and I'm injecting a password to my project:

IMAGE

The jenkins call a script.sh, but the script does not print varivavel PASS passed by jenkins.
As a step variable issued by Jenkins to my external script?

PASS=${PASSWORD}
echo PASSWORD=$PASS
sh /root/script.sh

Answer

You need to export your variable in order to make it available to subshells:

export PASS=${PASSWORD}
Comments