[refs #442] Add stop_build field

This commit is contained in:
konstantin.grabar 2012-06-29 19:17:25 +04:00
parent 6507ad280f
commit 561ebb8728
4 changed files with 21 additions and 16 deletions

View File

@ -52,8 +52,6 @@ class MassBuild < ActiveRecord::Base
end
def cancel_all
self.build_lists.find_each do |bl|
bl.cancel
end
self.update_attribute(:stop_build, true)
end
end

View File

@ -167,6 +167,7 @@ class Platform < ActiveRecord::Base
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|
@ -174,6 +175,7 @@ class Platform < ActiveRecord::Base
group.each do |p|
arches.map(&:name).each do |arch|
begin
return if mass_build.reload.stop_build
p.build_for(self, 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?

View File

@ -0,0 +1,5 @@
class AddStopBuildToMassBuilds < ActiveRecord::Migration
def change
add_column :mass_builds, :stop_build, :boolean, :null => false, :default => false
end
end

View File

@ -11,14 +11,14 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120628165702) do
ActiveRecord::Schema.define(:version => 20120629134216) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
t.string "kind"
t.text "data"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "advisories", :force => true do |t|
@ -211,6 +211,7 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.integer "build_publish_count", :default => 0
t.integer "build_error_count", :default => 0
t.string "rep_names"
t.boolean "stop_build", :default => false, :null => false
end
create_table "platforms", :force => true do |t|
@ -224,7 +225,7 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.string "owner_type"
t.string "visibility", :default => "open", :null => false
t.string "platform_type", :default => "main", :null => false
t.string "distrib_type", :null => false
t.string "distrib_type"
end
add_index "platforms", ["name"], :name => "index_platforms_on_name", :unique => true, :case_sensitive => false
@ -294,27 +295,25 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.text "description"
t.string "ancestry"
t.boolean "has_issues", :default => true
t.boolean "has_wiki", :default => false
t.string "srpm_file_name"
t.string "srpm_content_type"
t.integer "srpm_file_size"
t.datetime "srpm_updated_at"
t.boolean "has_wiki", :default => false
t.string "default_branch", :default => "master"
t.boolean "is_package", :default => true, :null => false
t.integer "average_build_time", :default => 0, :null => false
t.integer "build_count", :default => 0, :null => false
end
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true
create_table "register_requests", :force => true do |t|
t.string "name"
t.string "email"
t.string "token"
t.boolean "approved", :default => false
t.boolean "rejected", :default => false
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "interest"
t.text "more"
end
@ -368,6 +367,7 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.string "name"
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "password_salt", :default => "", :null => false
t.string "reset_password_token"
t.datetime "remember_created_at"
t.datetime "created_at"
@ -375,8 +375,11 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.string "uname"
t.string "role"
t.string "language", :default => "en"
t.datetime "reset_password_sent_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.integer "own_projects_count", :default => 0, :null => false
t.datetime "reset_password_sent_at"
t.text "professional_experience"
t.string "site"
t.string "company"
@ -388,9 +391,6 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
t.integer "failed_attempts", :default => 0
t.string "unlock_token"
t.datetime "locked_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "authentication_token"
t.integer "build_priority", :default => 50
end