2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
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-30 11:57:48 +00:00
|
|
|
call('create_product', pbl.id.to_s, pbl.product.platform.name, pbl.product.ks, pbl.product.menu, pbl.product.build_script,
|
|
|
|
pbl.product.counter, [], pbl.product.tar.exists? ? "#{pbl.base_url}#{pbl.product.tar.url}" : '')
|
2011-04-11 09:35:08 +01:00
|
|
|
end
|
|
|
|
end
|