File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ruby and the fly likes posting a modified hudson build config using Ruby script Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Other Languages » Ruby
Reply Bookmark "posting a modified hudson build config using Ruby script" Watch "posting a modified hudson build config using Ruby script" New topic
Author

posting a modified hudson build config using Ruby script

Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
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


Anadi Mishra.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
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


Spritle Software Blogs
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
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

Joined: Jan 23, 2002
Posts: 11945
It seems that you're trying to pass in a REXML document to http.get() while it's expecting a String.


Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
 
IntelliJ Java IDE
 
subject: posting a modified hudson build config using Ruby script
 
Threads others viewed
Using config.xml in weblogic 6.1
XML mapping framework
Help Needed regarding the automation of the build process
glassfish auto-generates unwanted session
Maven: No SCM URL was provided to perform the release from
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com