I'm using Paramterized Build, and know I can get paramter by name in bash like $name
.
But I want to write script with ruby, how can I get the paramter?
Thanks
I'm using Paramterized Build, and know I can get paramter by name in bash like $name
.
But I want to write script with ruby, how can I get the paramter?
Thanks
you should be able to get them using env variables
To send parameters to your ruby script, you may use the following way:
call the script and pass the parameters from the command line (for Jenkins, you may use execute shell script option)
$ irb ruby_script.rb parameter1 parameter2
and in ruby_script.rb, you can get these parameters by using builtin ruby syntax, ARGV:
parameter_one = ARGV[0] // refer to the first paramter
parameter_one = ARGV[1] // refer to the second paramter
You may refer to this issue