#778: send packages for cleanup on publishing

This commit is contained in:
Vokhmin Alexey V 2012-12-18 17:18:54 +04:00
parent 3dc1cb8124
commit d19f96abce
3 changed files with 6 additions and 1 deletions

View File

@ -56,7 +56,6 @@ class Projects::BuildListsController < Projects::BaseController
where(:id => params[:build_list][:include_repos]).group(:platform_id).map(&:platform_id)
new_core = BuildList.has_access_to_new_core?(current_user) && params[:build_list][:new_core] == '1'
params[:build_list][:auto_publish] = false if new_core
Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => build_for_platforms).each do |build_for_platform|
@build_list = @project.build_lists.build(params[:build_list])

View File

@ -275,6 +275,10 @@ class BuildList < ActiveRecord::Base
Dir.mkdir(platform_path) unless File.exists?(platform_path)
end
packages = last_published.includes(:packages).limit(5).map{ |bl| bl.packages }.flatten
sources = packages.map{ |p| p.fullname if p.package_type == 'source' }.compact
binaries = packages.map{ |p| p.fullname if p.package_type == 'binary' }.compact
Resque.push(
"publish_build_list_container_#{type}_worker",
'class' => "AbfWorker::PublishBuildListContainer#{type.capitalize}Worker",
@ -283,6 +287,7 @@ class BuildList < ActiveRecord::Base
:arch => arch.name,
:distrib_type => type,
:container_sha1 => archive['sha1'],
:packages => { :sources => sources, :binaries => binaries },
:platform => {
:platform_path => platform_path,
:released => save_to_platform.released

View File

@ -235,6 +235,7 @@ class Project < ActiveRecord::Base
:released => platform.released
},
:repository_name => repository.name,
:cleanup => true,
:save_results => false,
:time_living => 2400 # 40 min
}]