I'm attempting to make a quick hack way to load a bunch of projects
into DC, rather than use the GUI:
require "yaml"
require "net/http"
ARGV.each { |file|
config = File.open( file ) { |yf| YAML::load( yf ) }
config.each { |buildables|
response, data = Net::HTTP.post_form(
URI.parse("
http://localhost/project/create"),
{ 'project[name]'=>buildables['buildable']['name'],
'project[build_command]'=>buildables['buildable']['context'],
'scm[RSCM::Subversion][enabled]'=>'true',
'scm[RSCM::Subversion][revision_detection]'=>'ALWAYS_POLL',
'scm[RSCM::Subversion][username]'=>'build',
'scm[RSCM::Subversion][url]'=>buildables['buildable']['svn'],
'scm[RSCM::Subversion][password]'=>'sourcelabs'
})
}
}
It loads the data in happily, but the builds get stuck at the following stage:
17:55 Build (1) of revision [1160] is synching working copy
I know it's an inglorious hack; but any ideas on why it's not working?
I've had the code follow the redirect to the edit page, but it didn't
seem to improve things.
Hen