Merge pull request #264 from abf/rosa-build:19-pass-platform-name-for-all-workers

abf/abf-worker#19: pass platform name for all workers
This commit is contained in:
avokhmin 2013-08-13 13:56:23 +04:00
commit 807f007939
3 changed files with 34 additions and 16 deletions

View File

@ -424,13 +424,16 @@ class BuildList < ActiveRecord::Base
# git_project_address.gsub!(/^http:\/\/(0\.0\.0\.0|localhost)\:[\d]+/, 'https://abf.rosalinux.ru') unless Rails.env.production? # git_project_address.gsub!(/^http:\/\/(0\.0\.0\.0|localhost)\:[\d]+/, 'https://abf.rosalinux.ru') unless Rails.env.production?
{ {
:id => id, :id => id,
:arch => arch.name,
:time_living => (build_for_platform.platform_arch_settings.by_arch(arch).first.try(:time_living) || PlatformArchSetting::DEFAULT_TIME_LIVING), :time_living => (build_for_platform.platform_arch_settings.by_arch(arch).first.try(:time_living) || PlatformArchSetting::DEFAULT_TIME_LIVING),
:distrib_type => build_for_platform.distrib_type, :distrib_type => build_for_platform.distrib_type,
:git_project_address => git_project_address, :git_project_address => git_project_address,
:commit_hash => commit_hash, :commit_hash => commit_hash,
:include_repos => include_repos_hash, :include_repos => include_repos_hash,
:bplname => build_for_platform.name, :platform => {
:type => build_for_platform.distrib_type,
:name => build_for_platform.name,
:arch => arch.name
},
:user => {:uname => user.uname, :email => user.email} :user => {:uname => user.uname, :email => user.email}
} }
end end

View File

@ -168,8 +168,11 @@ class ProductBuildList < ActiveRecord::Base
:params => params, :params => params,
:time_living => time_living, :time_living => time_living,
:main_script => main_script, :main_script => main_script,
:arch => arch.name, :platform => {
:distrib_type => product.platform.distrib_type, :type => product.platform.distrib_type,
:name => product.platform.name,
:arch => arch.name
},
:user => {:uname => user.try(:uname), :email => user.try(:email)} :user => {:uname => user.try(:uname), :email => user.try(:email)}
} }
end end

View File

@ -110,10 +110,13 @@ module AbfWorker
'class' => 'AbfWorker::PublishWorkerDefault', 'class' => 'AbfWorker::PublishWorkerDefault',
'args' => [{ 'args' => [{
:id => build_list.id, :id => build_list.id,
:arch => build_list.arch.name,
:distrib_type => distrib_type,
:cmd_params => cmd_params, :cmd_params => cmd_params,
:platform => {:platform_path => platform_path}, :platform => {
:platform_path => platform_path,
:type => distrib_type,
:name => build_list.build_for_platform.name,
:arch => build_list.arch.name
},
:repository => {:id => build_list.save_to_repository_id}, :repository => {:id => build_list.save_to_repository_id},
:type => :publish, :type => :publish,
:time_living => 9600, # 160 min :time_living => 9600, # 160 min
@ -191,10 +194,13 @@ module AbfWorker
'class' => "AbfWorker::PublishWorkerDefault", 'class' => "AbfWorker::PublishWorkerDefault",
'args' => [{ 'args' => [{
:id => r.id, :id => r.id,
:arch => 'x86_64',
:distrib_type => distrib_type,
:cmd_params => cmd_params, :cmd_params => cmd_params,
:platform => {:platform_path => "#{r.platform.path}/repository"}, :platform => {
:platform_path => "#{r.platform.path}/repository",
:type => distrib_type,
:name => r.platform.name,
:arch => 'x86_64'
},
:repository => {:id => r.id}, :repository => {:id => r.id},
:type => :resign, :type => :resign,
:skip_feedback => true, :skip_feedback => true,
@ -301,10 +307,13 @@ module AbfWorker
lock_str = "#{save_to_repository_id}-#{build_for_platform_id}" lock_str = "#{save_to_repository_id}-#{build_for_platform_id}"
options = { options = {
:id => (bl ? bl.id : Time.now.to_i), :id => (bl ? bl.id : Time.now.to_i),
:arch => (bl ? bl.arch.name : 'x86_64'),
:distrib_type => distrib_type,
:cmd_params => cmd_params, :cmd_params => cmd_params,
:platform => {:platform_path => platform_path}, :platform => {
:platform_path => platform_path,
:type => distrib_type,
:name => build_for_platform.name,
:arch => (bl ? bl.arch.name : 'x86_64')
},
:repository => {:id => save_to_repository_id}, :repository => {:id => save_to_repository_id},
:type => :publish, :type => :publish,
:time_living => 9600, # 160 min :time_living => 9600, # 160 min
@ -369,10 +378,13 @@ module AbfWorker
options = { options = {
:id => Time.now.to_i, :id => Time.now.to_i,
:arch => 'x86_64',
:distrib_type => build_for_platform.distrib_type,
:cmd_params => cmd_params, :cmd_params => cmd_params,
:platform => {:platform_path => "#{rep.platform.path}/repository"}, :platform => {
:platform_path => "#{rep.platform.path}/repository",
:type => build_for_platform.distrib_type,
:name => build_for_platform.name,
:arch => 'x86_64'
},
:repository => {:id => rep.id}, :repository => {:id => rep.id},
:type => :publish, :type => :publish,
:time_living => 9600, # 160 min :time_living => 9600, # 160 min