Reputation: 943
Have:
Jenkins job that needs to execute bash command and initialise variable locally:
GOOD_VARIABLE=command
SSH into remote host and execute another command with above variable
command ${GOOD_VARIABLE}...
Problem:
I know how to ssh into another machine and execute command there but how can I pass that local variable to remote host?
Tried but didn't work:
Upvotes: 4
Views: 1769
Reputation: 1433
sounds like your problem is how to send a var through SSH.
You have a detailed answer there: https://unix.stackexchange.com/questions/299037/pass-variable-in-ssh
Don't forget the -T when using SSH through Jenkins!
Upvotes: -1