2011-04-11 09:35:08 +01:00
|
|
|
require 'xmlrpc/client'
|
2011-11-22 19:21:09 +00:00
|
|
|
|
2011-04-11 09:35:08 +01:00
|
|
|
class ProductBuilder
|
|
|
|
SUCCESS = 0
|
|
|
|
ERROR = 1
|
|
|
|
|
2011-11-28 20:38:50 +00:00
|
|
|
def self.client(distrib_type)
|
|
|
|
@@client ||= XMLRPC::Client.new3(:host => APP_CONFIG['product_builder_ip'][distrib_type], :port => APP_CONFIG['product_builder_port'], :path => APP_CONFIG['product_builder_path'])
|
2011-04-11 09:35:08 +01:00
|
|
|
end
|
|
|
|
|
2011-11-28 21:13:59 +00:00
|
|
|
def self.create_product pbl # product_build_list
|
|
|
|
self.client(pbl.product.platform.distrib_type).
|
2011-11-29 23:41:12 +00:00
|
|
|
call('create_product', pbl.id.to_s, pbl.product.platform.name, pbl.product.ks, pbl.product.menu,
|
2011-11-28 21:13:59 +00:00
|
|
|
pbl.product.build_script, pbl.product.counter, [], "#{pbl.base_url}#{pbl.product.tar.url}")
|
2011-04-11 09:35:08 +01:00
|
|
|
end
|
|
|
|
end
|