Jenkins execute shell scripts with parameters on remote machine

Swaroop Kundeti picture Swaroop Kundeti · May 5, 2015 · Viewed 13.3k times · Source

I have a Jenkins job which executes a shell script on remote server. Now I would like to send some parameters along with the shell script. Below example might get you more idea.

variable1={git-URL}
variable2={branch}

I want this parameters to be passed on to shell script which is on remote machine and should execute like below

#/usr/local/bin/check_out_code.sh <git-url> <branch>

Would be great if anyone can point me some work around for this

Thanks.

Answer

Slav picture Slav · May 5, 2015

You can reference any environment variable, including Jenkins parameters, as any other variable in linux: ${VARNAME}