I am new to ruby and to this gem.
trying to automate some jenkins builds, so i wrote up a quick script to launch a demo job. The job works fine on my test jenkins server, but is failing with the subject error on the production one.
I can see the job is being triggered, so its probably something when querying for status or something. Jenkins version is 1.532.2.2 (Jenkins Enterprise by CloudBees 13.11)
require 'jenkins_api_client'
begin
:username=> ARGV[0],
:password=> ARGV[1],
:log_level=> Logger::DEBUG
)
puts @client.job.list_all
puts @client.get_jenkins_version
puts "Starting job sequence"
completed=false
on_progress = lambda do |max,curr,count|
puts " maxwait #{max} current_wait #{curr} current_count #{count}"
end
on_completed = lambda do |build_number,cancelled|
puts "done build #{build_number} cancelled #{cancelled}"
completed = true
end
opts = {'build_start_timeout' => 300,
'cancel_on_build_start_timeout' => true,
'progress_proc' => on_progress ,
'completion_proc' => on_completed
}
@client.job.build("script_test_job", {}, opts)
puts "Job launched, waiting now"
sleep 2 until completed
end
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jenkins_api_client-1.0.1/lib/jenkins_api_client/client.rb:534:in `compare_versions': undefined method `[]' for nil:NilClass (NoMethodError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jenkins_api_client-1.0.1/lib/jenkins_api_client/job.rb:792:in `build'
from C:/gitdev/TestAndTrials/jenkins_demo/launch_dev_jenins.rb:29:in `<main>'