rosa-build/bin/xml-client-demo.rb

37 lines
1.1 KiB
Ruby
Raw Normal View History

2011-10-25 01:14:46 +01:00
#!/usr/bin/env ruby
require 'rubygems'
require 'xmlrpc/client'
2011-10-30 19:01:08 +00:00
require 'pp'
2011-10-25 01:14:46 +01:00
# Please correctly fill following vars
@host = 'npp-build.rosalab.ru'
@port = 80
@user = 'pchipiga@ya.ru'
@password = '123456'
2011-10-25 01:14:46 +01:00
puts 'PLATFORMS'
client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900)
2011-10-30 19:01:08 +00:00
pp client.call("platforms")
2011-10-25 01:14:46 +01:00
puts 'USER PROJECTS'
client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900)
2011-10-30 19:01:08 +00:00
pp client.call("user_projects")
2011-10-25 01:14:46 +01:00
puts 'PROJECT VERSIONS'
client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900)
project_id = 1 # FIXME!
2011-10-30 19:01:08 +00:00
pp client.call("project_versions", project_id)
2011-10-25 01:14:46 +01:00
puts 'BUILD STATUS'
client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900)
build_list_id = 1 # FIXME
2011-10-30 19:01:08 +00:00
pp client.call("build_status", build_list_id)
2011-10-25 01:14:46 +01:00
puts 'BUILD PACKET'
client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900)
project_id = 1 # FIXME
repo_id = 1 # FIXME
2011-10-30 19:01:08 +00:00
pp client.call("build_packet", project_id, repo_id)
2011-10-25 01:14:46 +01:00
puts 'DONE'