How to use Jenkins parameters in a shell script

IMRAN SHAIK picture IMRAN SHAIK · Aug 24, 2016 · Viewed 75.9k times · Source

I want to use the parameters that we define in the Jenkins job as arguments to the shell commands in the same job.

I have created a parameterized build with the following parameters:

high.version: 234
low.version: 220

I want to use these variables as arguments for the build's shell script:

/bin/bash /hai/mycode/scripts/run_script.sh high.version

How do I these parameters in the same job?

Answer

Florian Straub picture Florian Straub · Jan 17, 2017

What really helped me was Hudson: How to pass parameters to shell script

Solution: the variables are UPPERCASE even you define them in lowercase!