Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

posting a modified hudson build config using Ruby script

 
Ranch Hand
Posts: 69
  • 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
 
author and deputy
Posts: 3150
  • 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
  • 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

 
author
Posts: 11962
5
  • 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.
 
Do not threaten THIS beaver! Not even with this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic