Merge branch 'master' of github.com:warpc/rosa-build
This commit is contained in:
commit
6a0092bbb6
|
@ -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 :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']}
|
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 :create_directory
|
||||||
before_save :make_owner_rel
|
before_save :make_owner_rel
|
||||||
after_destroy :remove_directory
|
after_destroy :remove_directory
|
||||||
# before_create :xml_rpc_create
|
before_create :xml_rpc_create
|
||||||
# before_destroy :xml_rpc_destroy
|
before_destroy :xml_rpc_destroy
|
||||||
# before_update :check_freezing
|
# before_update :check_freezing
|
||||||
|
|
||||||
scope :by_visibilities, lambda {|v| {:conditions => ['visibility in (?)', v.join(',')]}}
|
scope :by_visibilities, lambda {|v| {:conditions => ['visibility in (?)', v.join(',')]}}
|
||||||
|
@ -97,33 +97,33 @@ class Platform < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_rpc_create
|
def xml_rpc_create
|
||||||
return true
|
# return true
|
||||||
# result = BuildServer.add_platform unixname, APP_CONFIG['root_path']
|
result = BuildServer.add_platform unixname, APP_CONFIG['root_path'], distrib_type
|
||||||
# if result == BuildServer::SUCCESS
|
if result == BuildServer::SUCCESS
|
||||||
# return true
|
return true
|
||||||
# else
|
else
|
||||||
# raise "Failed to create platform #{name}. Path: #{build_path(unixname)}"
|
raise "Failed to create platform #{name}. Path: #{build_path(unixname)}"
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_rpc_destroy
|
def xml_rpc_destroy
|
||||||
return true
|
# return true
|
||||||
# result = BuildServer.delete_platform unixname
|
result = BuildServer.delete_platform unixname
|
||||||
# if result == BuildServer::SUCCESS
|
if result == BuildServer::SUCCESS
|
||||||
# return true
|
return true
|
||||||
# else
|
else
|
||||||
# raise "Failed to delete platform #{unixname}."
|
raise "Failed to delete platform #{unixname}."
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_rpc_clone(new_unixname)
|
def xml_rpc_clone(new_unixname)
|
||||||
return true
|
# return true
|
||||||
# result = BuildServer.clone_platform new_unixname, self.unixname, APP_CONFIG['root_path']
|
result = BuildServer.clone_platform new_unixname, self.unixname, APP_CONFIG['root_path']
|
||||||
# if result == BuildServer::SUCCESS
|
if result == BuildServer::SUCCESS
|
||||||
# return true
|
return true
|
||||||
# else
|
else
|
||||||
# raise "Failed to clone platform #{name}. Path: #{build_path(unixname)} to platform #{new_unixname}"
|
raise "Failed to clone platform #{name}. Path: #{build_path(unixname)} to platform #{new_unixname}"
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_freezing
|
def check_freezing
|
||||||
|
|
|
@ -26,8 +26,8 @@ class Repository < ActiveRecord::Base
|
||||||
before_save :make_owner_rel
|
before_save :make_owner_rel
|
||||||
#after_destroy :remove_directory
|
#after_destroy :remove_directory
|
||||||
|
|
||||||
# before_create :xml_rpc_create
|
before_create :xml_rpc_create
|
||||||
# before_destroy :xml_rpc_destroy
|
before_destroy :xml_rpc_destroy
|
||||||
|
|
||||||
after_create lambda {
|
after_create lambda {
|
||||||
add_downloads_symlink unless self.hidden?
|
add_downloads_symlink unless self.hidden?
|
||||||
|
|
|
@ -19,8 +19,8 @@ class BuildServer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.add_platform name, root_folder, repos = {:src => [], :rpm => []}
|
def self.add_platform name, root_folder, repos = {:src => [], :rpm => []}, distrib_type
|
||||||
self.client.call('add_platform', name, root_folder, repos)
|
self.client.call('add_platform', name, root_folder, repos, distrib_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue