Merge branch 'master' of github.com:warpc/rosa-build

This commit is contained in:
George Vinogradov 2011-10-27 20:32:26 +04:00
commit 6a0092bbb6
3 changed files with 28 additions and 28 deletions

View File

@ -17,12 +17,12 @@ class Platform < ActiveRecord::Base
validates :unixname, :uniqueness => true, :presence => true, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false
validates :distrib_type, :presence => true, :allow_nil => :false, :allow_blank => false, :inclusion => {:in => APP_CONFIG['distr_types']}
#after_create :make_owner_rel
after_create :make_owner_rel
# before_save :create_directory
before_save :make_owner_rel
after_destroy :remove_directory
# before_create :xml_rpc_create
# before_destroy :xml_rpc_destroy
before_create :xml_rpc_create
before_destroy :xml_rpc_destroy
# before_update :check_freezing
scope :by_visibilities, lambda {|v| {:conditions => ['visibility in (?)', v.join(',')]}}
@ -97,33 +97,33 @@ class Platform < ActiveRecord::Base
end
def xml_rpc_create
return true
# result = BuildServer.add_platform unixname, APP_CONFIG['root_path']
# if result == BuildServer::SUCCESS
# return true
# else
# raise "Failed to create platform #{name}. Path: #{build_path(unixname)}"
# end
# return true
result = BuildServer.add_platform unixname, APP_CONFIG['root_path'], distrib_type
if result == BuildServer::SUCCESS
return true
else
raise "Failed to create platform #{name}. Path: #{build_path(unixname)}"
end
end
def xml_rpc_destroy
return true
# result = BuildServer.delete_platform unixname
# if result == BuildServer::SUCCESS
# return true
# else
# raise "Failed to delete platform #{unixname}."
# end
# return true
result = BuildServer.delete_platform unixname
if result == BuildServer::SUCCESS
return true
else
raise "Failed to delete platform #{unixname}."
end
end
def xml_rpc_clone(new_unixname)
return true
# result = BuildServer.clone_platform new_unixname, self.unixname, APP_CONFIG['root_path']
# if result == BuildServer::SUCCESS
# return true
# else
# raise "Failed to clone platform #{name}. Path: #{build_path(unixname)} to platform #{new_unixname}"
# end
# return true
result = BuildServer.clone_platform new_unixname, self.unixname, APP_CONFIG['root_path']
if result == BuildServer::SUCCESS
return true
else
raise "Failed to clone platform #{name}. Path: #{build_path(unixname)} to platform #{new_unixname}"
end
end
def check_freezing

View File

@ -26,8 +26,8 @@ class Repository < ActiveRecord::Base
before_save :make_owner_rel
#after_destroy :remove_directory
# before_create :xml_rpc_create
# before_destroy :xml_rpc_destroy
before_create :xml_rpc_create
before_destroy :xml_rpc_destroy
after_create lambda {
add_downloads_symlink unless self.hidden?

View File

@ -19,8 +19,8 @@ class BuildServer
end
def self.add_platform name, root_folder, repos = {:src => [], :rpm => []}
self.client.call('add_platform', name, root_folder, repos)
def self.add_platform name, root_folder, repos = {:src => [], :rpm => []}, distrib_type
self.client.call('add_platform', name, root_folder, repos, distrib_type)
end