add new column to build_lists table, some refactoring

This commit is contained in:
Vokhmin Alexey V 2012-11-30 14:41:39 +04:00
parent b468f0655f
commit fcdbfd4538
7 changed files with 14 additions and 14 deletions

View File

@ -111,12 +111,6 @@ class Projects::BuildListsController < Projects::BaseController
:log => @build_list.log(params[:load_lines]),
:building => @build_list.build_started?
}
# @log = `tail -n #{params[:load_lines].to_i} #{Rails.root + 'public' + @build_list.fs_log_path}`
# @log = t("layout.build_lists.log.not_available") unless $?.success?
# respond_to do |format|
# format.json { render :json => { :log => @log, :building => @build_list.build_started? } }
# end
end
def publish_build

View File

@ -117,8 +117,6 @@ class BuildList < ActiveRecord::Base
after_commit :place_build
after_destroy :delete_container
attr_accessor :new_core
@queue = :clone_and_build
state_machine :status, :initial => :waiting_for_response do
@ -300,7 +298,7 @@ class BuildList < ActiveRecord::Base
end
def add_to_queue
if @new_core
if new_core?
add_to_abf_worker_queue
else
#XML-RPC params: project_name, project_version, plname, arch, bplname, update_type, build_requires, id_web, include_repos, priority, git_project_address
@ -377,8 +375,9 @@ class BuildList < ActiveRecord::Base
end
def log(load_lines)
log = Resque.redis.get("abfworker::rpm-worker-#{id}")
unless log
if new_core?
log = Resque.redis.get("abfworker::rpm-worker-#{id}")
else
log = `tail -n #{load_lines.to_i} #{Rails.root + 'public' + fs_log_path}`
log = nil unless $?.success?
end

View File

@ -59,6 +59,9 @@
.leftlist= t("activerecord.attributes.build_list.is_circle")
.rightlist= t("layout.#{@build_list.is_circle?}_")
.both
.leftlist= t("activerecord.attributes.build_list.new_core")
.rightlist= t("layout.#{@build_list.new_core?}_")
.both
- if @build_list.mass_build_id.present?
.leftlist= t("activerecord.attributes.mass_build_id")
@ -124,9 +127,9 @@
var r = new Rosa.Routers.BuildListsAdvisoriesRouter();
});
- if BuildList::HUMAN_STATUSES[@build_list.status].in? [:build_started, :build_error]
= render 'shared/log', { :build_started => @build_list.build_started?, :get_log_path => log_build_list_path(@build_list) }
- if BuildList::HUMAN_STATUSES[@build_list.status].in? [:build_started, :build_error, :success]
- log_params = { :build_started => @build_list.build_started?, :get_log_path => log_build_list_path(@build_list) }
= render 'shared/log', ( @build_list.new_core? ? log_params : log_params.merge({:download_log_url => build_list_log_url(:build)}) )
- if (can_publish = @build_list.can_publish? && can?(:publish, @build_list))
.hr

View File

@ -13,6 +13,7 @@ en:
project: Project
arch_id: Architecture
arch: Architecture
new_core: New core
is_circle: Recurrent build
updated_at: Notified at
additional_repos: Additional repositories

View File

@ -13,6 +13,7 @@ ru:
project: Проект
arch_id: Архитектура
arch: Архитектура
new_core: Новое ядро
is_circle: Циклическая сборка
updated_at: Информация получена
additional_repos: Дополнительные репозитории

View File

@ -1,5 +1,6 @@
class AddResultsToBuildList < ActiveRecord::Migration
def change
add_column :build_lists, :results, :text
add_column :build_lists, :new_core, :boolean
end
end

View File

@ -131,6 +131,7 @@ ActiveRecord::Schema.define(:version => 20121127122032) do
t.integer "mass_build_id"
t.integer "save_to_repository_id"
t.text "results"
t.boolean "new_core"
end
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"