1

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

goofansu
  • 2,277
  • 3
  • 30
  • 48

2 Answers2

0

you should be able to get them using env variables

http://ruby.about.com/od/rubyfeatures/a/envvar.htm

Kalpesh Soni
  • 6,879
  • 2
  • 56
  • 59
0

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