I have a Jenkins job, 'auto-pbuilder', that takes a couple of parameters. When I try to trigger a build with parameters using the jenkins_api_client gem, the build is triggered, but the parameters are not sent over - the defaults are used instead.
Below is my code. According to the "Parameterized Build" page on the Jenkins wiki,
the only examples given are passing parameters in the URL, but when I
tcpdumped it looks like the parameters are being sent in the POST
payload instead.
job_name = "auto-pbuilder"
job_params = { :DIST => 'precise', :tag => tag }
client = JenkinsApi::Client.new(:server_ip => '10.10.10.10', :log_level => Logger::DEBUG, :log_location => '/var/tmp/jenkins.log')
jenkins_job = JenkinsApi::Client::Job.new(client)
return_code = jenkins_job.build(job_name, :params => job_params)
When I trigger this code and I tcpdump the connection to see what is going on, I do not see the build parameters being sent as URL arguments, instead they are being sent in the POST body.
20:08:43.437872 IP client.53368 > jenkins-1.webcache: Flags [P.], seq 1:219, ack 1, win 115, options [nop,nop,TS val 2245938866 ecr 1601428328], length 218E....@.@...|?.|>..x..mq_..+.)...s.........N._s.hPOST /job/auto-pbuilder/buildWithParameters HTTP/1.1Accept: */*User-Agent: RubyContent-Type: application/x-www-form-urlencodedConnection: closeHost: 10.124.62.46:8080Content-Length: 13420:08:43.438086 IP jenkins-1.webcache > client.53368: Flags [.], ack 219, win 122, options [nop,nop,TS val 1601428329 ecr 2245938866], length 0E..4.@@.@...|>.|?....x.+.)mq`....z5......_s.i..N.20:08:43.438100 IP client.53368 > jenkins-1.webcache: Flags [P.], seq 219:353, ack 1, win 115, options [nop,nop,TS val 2245938867 ecr 1601428329], length 134E.....@.@..H|?.|>..x..mq`..+.)...s.........N._s.iparams=%7B%3ADIST%3D%3E%22precise%22%2C+%3Atag%3D%3E%222015.1%22%2C So, if Jenkins is ignoring the parameters sent in the POST payload, does it need for the parameters to be sent in the URL? And if so, how do I use the jenkins_api_client gem to effect that result? Or am I doing this incorrectly?
Thanks,
--N.