#778: revers tome changes
This commit is contained in:
parent
d19f96abce
commit
06f629fdd6
|
@ -176,33 +176,6 @@ class Platform < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_all(opts={})
|
|
||||||
# Set options to build all need
|
|
||||||
repositories = opts[:repositories] ? self.repositories.where(:id => opts[:repositories]) : self.repositories
|
|
||||||
arches = opts[:arches] ? Arch.where(:id => opts[:arches]) : Arch.all
|
|
||||||
auto_publish = opts[:auto_publish] || false
|
|
||||||
user = opts[:user]
|
|
||||||
mass_build_id = opts[:mass_build_id]
|
|
||||||
mass_build = MassBuild.find mass_build_id
|
|
||||||
|
|
||||||
repositories.each do |rep|
|
|
||||||
rep.projects.find_in_batches(:batch_size => 2) do |group|
|
|
||||||
sleep 1
|
|
||||||
group.each do |p|
|
|
||||||
arches.map(&:name).each do |arch|
|
|
||||||
begin
|
|
||||||
return if mass_build.reload.stop_build
|
|
||||||
p.build_for(self, rep.id, user, arch, auto_publish, mass_build_id)
|
|
||||||
rescue RuntimeError, Exception
|
|
||||||
# p.async(:build_for, self, user, arch, auto_publish, mass_build_id) # TODO need this?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
later :build_all, :loner => true, :queue => :clone_build
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
with_skip {super} # avoid cascade XML RPC requests
|
with_skip {super} # avoid cascade XML RPC requests
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class ProjectToRepository < ActiveRecord::Base
|
||||||
|
|
||||||
delegate :path, :to => :project
|
delegate :path, :to => :project
|
||||||
|
|
||||||
after_destroy lambda { project.destroy_project_from_repository(repository) }
|
after_destroy lambda { project.destroy_project_from_repository(repository) }, :unless => lambda {Thread.current[:skip]}
|
||||||
|
|
||||||
validate :one_project_in_platform_repositories
|
validate :one_project_in_platform_repositories
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Repository < ActiveRecord::Base
|
||||||
|
|
||||||
scope :recent, order("name ASC")
|
scope :recent, order("name ASC")
|
||||||
|
|
||||||
before_destroy :detele_directory
|
before_destroy :detele_directory, :unless => lambda {Thread.current[:skip]}
|
||||||
|
|
||||||
attr_accessible :name, :description, :publish_without_qa
|
attr_accessible :name, :description, :publish_without_qa
|
||||||
attr_readonly :name, :platform_id
|
attr_readonly :name, :platform_id
|
||||||
|
|
Loading…
Reference in New Issue