add selecting Arch on create product build
This commit is contained in:
parent
abbbacdf7f
commit
f522fd3cd0
|
@ -19,13 +19,15 @@ class ProductBuildList < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :product
|
belongs_to :product
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
belongs_to :arch
|
||||||
|
|
||||||
|
|
||||||
validates :product_id,
|
validates :product_id,
|
||||||
:status,
|
:status,
|
||||||
:project_id,
|
:project_id,
|
||||||
:main_script,
|
:main_script,
|
||||||
:time_living, :presence => true
|
:time_living,
|
||||||
|
:arch_id, :presence => true
|
||||||
validates :status, :inclusion => { :in => [BUILD_STARTED, BUILD_COMPLETED, BUILD_FAILED] }
|
validates :status, :inclusion => { :in => [BUILD_STARTED, BUILD_COMPLETED, BUILD_FAILED] }
|
||||||
|
|
||||||
attr_accessor :base_url
|
attr_accessor :base_url
|
||||||
|
@ -37,7 +39,8 @@ class ProductBuildList < ActiveRecord::Base
|
||||||
:params,
|
:params,
|
||||||
:project_version,
|
:project_version,
|
||||||
:commit_hash,
|
:commit_hash,
|
||||||
:time_living
|
:time_living,
|
||||||
|
:arch_id
|
||||||
attr_readonly :product_id
|
attr_readonly :product_id
|
||||||
serialize :results, Array
|
serialize :results, Array
|
||||||
|
|
||||||
|
@ -106,7 +109,9 @@ class ProductBuildList < ActiveRecord::Base
|
||||||
:srcpath => srcpath,
|
:srcpath => srcpath,
|
||||||
:params => params,
|
:params => params,
|
||||||
:time_living => time_living,
|
:time_living => time_living,
|
||||||
:main_script => main_script
|
:main_script => main_script,
|
||||||
|
:arch => arch.name,
|
||||||
|
:distrib_type => product.platform.distrib_type
|
||||||
}
|
}
|
||||||
Resque.push(
|
Resque.push(
|
||||||
'iso_worker',
|
'iso_worker',
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
.rightlist= f.select :project_version, versions_for_group_select(pbl.project), :selected => params[:product_build_lists].try(:fetch, :project_version) || "latest_" + pbl.project.default_branch
|
.rightlist= f.select :project_version, versions_for_group_select(pbl.project), :selected => params[:product_build_lists].try(:fetch, :project_version) || "latest_" + pbl.project.default_branch
|
||||||
.both
|
.both
|
||||||
|
|
||||||
|
.leftlist= f.label :arch, t("activerecord.attributes.product_build_list.arch"), :class => :label
|
||||||
|
.rightlist= f.select :arch_id, Arch.recent.map{ |a| [a.name, a.id]}
|
||||||
|
.both
|
||||||
|
|
||||||
= render 'platforms/products/def_fields', :f => f
|
= render 'platforms/products/def_fields', :f => f
|
||||||
|
|
||||||
= f.submit t("layout.projects.build_button")
|
= f.submit t("layout.projects.build_button")
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
= render 'show_field', :key => :project_version, :value => build_list_version_link(pbl, true)
|
= render 'show_field', :key => :project_version, :value => build_list_version_link(pbl, true)
|
||||||
|
|
||||||
- [:main_script, :params, :time_living].each do |el|
|
- [:arch, :main_script, :params, :time_living].each do |el|
|
||||||
= render 'show_field', :key => el, :value => pbl.send(el)
|
= render 'show_field', :key => el, :value => pbl.send(el)
|
||||||
|
|
||||||
= render 'show_field', :key => :notified_at, :value => l(pbl.updated_at, :format => :long)
|
= render 'show_field', :key => :notified_at, :value => l(pbl.updated_at, :format => :long)
|
||||||
|
|
|
@ -42,6 +42,7 @@ en:
|
||||||
main_script: Main script
|
main_script: Main script
|
||||||
params: Params for running script
|
params: Params for running script
|
||||||
time_living: Max time for building (in minutes)
|
time_living: Max time for building (in minutes)
|
||||||
|
arch: Arch
|
||||||
product_build_list/results:
|
product_build_list/results:
|
||||||
file_name: File name
|
file_name: File name
|
||||||
sha1: SHA1
|
sha1: SHA1
|
||||||
|
|
|
@ -42,6 +42,7 @@ ru:
|
||||||
main_script: Основной скрипт
|
main_script: Основной скрипт
|
||||||
params: Параметры для запуска скрипта
|
params: Параметры для запуска скрипта
|
||||||
time_living: Максимальное время сборки (в минутах)
|
time_living: Максимальное время сборки (в минутах)
|
||||||
|
arch: Архитектура
|
||||||
product_build_list/results:
|
product_build_list/results:
|
||||||
file_name: Имя файла
|
file_name: Имя файла
|
||||||
sha1: SHA1
|
sha1: SHA1
|
||||||
|
|
|
@ -24,6 +24,7 @@ class IntegrateNewIsoBuilderWithProducts < ActiveRecord::Migration
|
||||||
add_column :products, :main_script, :string
|
add_column :products, :main_script, :string
|
||||||
|
|
||||||
add_column :product_build_lists, :results, :text
|
add_column :product_build_lists, :results, :text
|
||||||
|
add_column :product_build_lists, :arch_id, :integer
|
||||||
|
|
||||||
add_column :products, :time_living, :integer
|
add_column :products, :time_living, :integer
|
||||||
add_column :product_build_lists, :time_living, :integer
|
add_column :product_build_lists, :time_living, :integer
|
||||||
|
@ -54,6 +55,7 @@ class IntegrateNewIsoBuilderWithProducts < ActiveRecord::Migration
|
||||||
remove_column :products, :main_script
|
remove_column :products, :main_script
|
||||||
|
|
||||||
remove_column :product_build_lists, :results
|
remove_column :product_build_lists, :results
|
||||||
|
remove_column :product_build_lists, :arch_id
|
||||||
|
|
||||||
remove_column :product_build_lists, :time_living
|
remove_column :product_build_lists, :time_living
|
||||||
remove_column :products, :time_living
|
remove_column :products, :time_living
|
||||||
|
|
|
@ -287,6 +287,7 @@ ActiveRecord::Schema.define(:version => 20121106113338) do
|
||||||
t.string "params"
|
t.string "params"
|
||||||
t.string "main_script"
|
t.string "main_script"
|
||||||
t.text "results"
|
t.text "results"
|
||||||
|
t.integer "arch_id"
|
||||||
t.integer "time_living"
|
t.integer "time_living"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -88,11 +88,12 @@ describe Platforms::ProductBuildListsController do
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@product = FactoryGirl.create(:product)
|
@product = FactoryGirl.create(:product)
|
||||||
|
@arch = FactoryGirl.create(:arch)
|
||||||
@pbl = FactoryGirl.create(:product_build_list, :product => @product)
|
@pbl = FactoryGirl.create(:product_build_list, :product => @product)
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_attributes
|
def valid_attributes
|
||||||
{:product_id => @product.id, :platform_id => @product.platform_id, :product_build_list => {:main_script => 'build.sh', :time_living => 60, :project_version => 'latest_master'}}
|
{:product_id => @product.id, :platform_id => @product.platform_id, :product_build_list => {:main_script => 'build.sh', :time_living => 60, :project_version => 'latest_master', :arch_id => @arch.id}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_attributes_for_destroy
|
def valid_attributes_for_destroy
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :product_build_list do
|
factory :product_build_list do
|
||||||
association :product, :factory => :product
|
association :product, :factory => :product
|
||||||
|
association :arch, :factory => :arch
|
||||||
project { |pbl| pbl.product.project }
|
project { |pbl| pbl.product.project }
|
||||||
status 0 # BUILD_COMPLETED
|
status 0 # BUILD_COMPLETED
|
||||||
main_script 'build.sh'
|
main_script 'build.sh'
|
||||||
|
|
Loading…
Reference in New Issue