File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

posting a modified hudson build config using Ruby script

 
Anadi Misra
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a ruby script that creates a release branch from trunk at the start of every release cycle in my project. we recently moved to hudson so I though it will be good if the script itself downloads and modifies Hudson release build config and posts it back. I read from here that it is possible to programatically modify the configuration on Hudson and POST the same XML.

For example if the build is at URL http://somthing.builder.ad/hudson/job/branch then http://somthing.builder.ad/hudson/job/branch/config.xml is the configuration that can be modify and POST-ed back at the latter URL.

My ruby script always gives a 400. please help. here's the script



I also tried the RestClient but it seems that does not support POST'ing files
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Have you tried posting your xml file using some http utility tools like Poster in Firefox to your hudson server ('http://my.buildserver.com/hudson/job/branch/config.xml') ?
Does it accept such submission ?
Regards
Balaji
 
Anadi Misra
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thanks I tried usign the Poster and got it to work when i changed Content-Type header to text/xml however when i tried from the ruby code after making changes I got this error



here's the updated script

 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that you're trying to pass in a REXML document to http.get() while it's expecting a String.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic