add new column to build_lists table, some refactoring
This commit is contained in:
parent
b468f0655f
commit
fcdbfd4538
|
@ -111,12 +111,6 @@ class Projects::BuildListsController < Projects::BaseController
|
||||||
:log => @build_list.log(params[:load_lines]),
|
:log => @build_list.log(params[:load_lines]),
|
||||||
:building => @build_list.build_started?
|
: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
|
end
|
||||||
|
|
||||||
def publish_build
|
def publish_build
|
||||||
|
|
|
@ -117,8 +117,6 @@ class BuildList < ActiveRecord::Base
|
||||||
after_commit :place_build
|
after_commit :place_build
|
||||||
after_destroy :delete_container
|
after_destroy :delete_container
|
||||||
|
|
||||||
attr_accessor :new_core
|
|
||||||
|
|
||||||
@queue = :clone_and_build
|
@queue = :clone_and_build
|
||||||
|
|
||||||
state_machine :status, :initial => :waiting_for_response do
|
state_machine :status, :initial => :waiting_for_response do
|
||||||
|
@ -300,7 +298,7 @@ class BuildList < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_to_queue
|
def add_to_queue
|
||||||
if @new_core
|
if new_core?
|
||||||
add_to_abf_worker_queue
|
add_to_abf_worker_queue
|
||||||
else
|
else
|
||||||
#XML-RPC params: project_name, project_version, plname, arch, bplname, update_type, build_requires, id_web, include_repos, priority, git_project_address
|
#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
|
end
|
||||||
|
|
||||||
def log(load_lines)
|
def log(load_lines)
|
||||||
log = Resque.redis.get("abfworker::rpm-worker-#{id}")
|
if new_core?
|
||||||
unless log
|
log = Resque.redis.get("abfworker::rpm-worker-#{id}")
|
||||||
|
else
|
||||||
log = `tail -n #{load_lines.to_i} #{Rails.root + 'public' + fs_log_path}`
|
log = `tail -n #{load_lines.to_i} #{Rails.root + 'public' + fs_log_path}`
|
||||||
log = nil unless $?.success?
|
log = nil unless $?.success?
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,9 @@
|
||||||
.leftlist= t("activerecord.attributes.build_list.is_circle")
|
.leftlist= t("activerecord.attributes.build_list.is_circle")
|
||||||
.rightlist= t("layout.#{@build_list.is_circle?}_")
|
.rightlist= t("layout.#{@build_list.is_circle?}_")
|
||||||
.both
|
.both
|
||||||
|
.leftlist= t("activerecord.attributes.build_list.new_core")
|
||||||
|
.rightlist= t("layout.#{@build_list.new_core?}_")
|
||||||
|
.both
|
||||||
|
|
||||||
- if @build_list.mass_build_id.present?
|
- if @build_list.mass_build_id.present?
|
||||||
.leftlist= t("activerecord.attributes.mass_build_id")
|
.leftlist= t("activerecord.attributes.mass_build_id")
|
||||||
|
@ -124,9 +127,9 @@
|
||||||
var r = new Rosa.Routers.BuildListsAdvisoriesRouter();
|
var r = new Rosa.Routers.BuildListsAdvisoriesRouter();
|
||||||
});
|
});
|
||||||
|
|
||||||
- if BuildList::HUMAN_STATUSES[@build_list.status].in? [:build_started, :build_error]
|
- if BuildList::HUMAN_STATUSES[@build_list.status].in? [:build_started, :build_error, :success]
|
||||||
= render 'shared/log', { :build_started => @build_list.build_started?, :get_log_path => log_build_list_path(@build_list) }
|
- 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))
|
- if (can_publish = @build_list.can_publish? && can?(:publish, @build_list))
|
||||||
.hr
|
.hr
|
||||||
|
|
|
@ -13,6 +13,7 @@ en:
|
||||||
project: Project
|
project: Project
|
||||||
arch_id: Architecture
|
arch_id: Architecture
|
||||||
arch: Architecture
|
arch: Architecture
|
||||||
|
new_core: New core
|
||||||
is_circle: Recurrent build
|
is_circle: Recurrent build
|
||||||
updated_at: Notified at
|
updated_at: Notified at
|
||||||
additional_repos: Additional repositories
|
additional_repos: Additional repositories
|
||||||
|
|
|
@ -13,6 +13,7 @@ ru:
|
||||||
project: Проект
|
project: Проект
|
||||||
arch_id: Архитектура
|
arch_id: Архитектура
|
||||||
arch: Архитектура
|
arch: Архитектура
|
||||||
|
new_core: Новое ядро
|
||||||
is_circle: Циклическая сборка
|
is_circle: Циклическая сборка
|
||||||
updated_at: Информация получена
|
updated_at: Информация получена
|
||||||
additional_repos: Дополнительные репозитории
|
additional_repos: Дополнительные репозитории
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class AddResultsToBuildList < ActiveRecord::Migration
|
class AddResultsToBuildList < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :build_lists, :results, :text
|
add_column :build_lists, :results, :text
|
||||||
|
add_column :build_lists, :new_core, :boolean
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -131,6 +131,7 @@ ActiveRecord::Schema.define(:version => 20121127122032) do
|
||||||
t.integer "mass_build_id"
|
t.integer "mass_build_id"
|
||||||
t.integer "save_to_repository_id"
|
t.integer "save_to_repository_id"
|
||||||
t.text "results"
|
t.text "results"
|
||||||
|
t.boolean "new_core"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"
|
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"
|
||||||
|
|
Loading…
Reference in New Issue