diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 36f5c573b..14338d3fa 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -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 diff --git a/app/models/build_list.rb b/app/models/build_list.rb index b1aa9a576..0c16a9a93 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -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 diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 3dc935547..3f5236029 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -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 diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 5f9a1e18a..8d381f75b 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -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 diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index f154a7803..a04a52864 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -13,6 +13,7 @@ ru: project: Проект arch_id: Архитектура arch: Архитектура + new_core: Новое ядро is_circle: Циклическая сборка updated_at: Информация получена additional_repos: Дополнительные репозитории diff --git a/db/migrate/20121127122032_add_results_to_build_list.rb b/db/migrate/20121127122032_add_results_to_build_list.rb index 0bee2f39e..dbc8fabfe 100644 --- a/db/migrate/20121127122032_add_results_to_build_list.rb +++ b/db/migrate/20121127122032_add_results_to_build_list.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index b40e02f98..99e93f409 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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"