From 9477a0af4b6d42d644ead3b015ac342c03b68ae0 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 12 Aug 2013 18:26:57 +0400 Subject: [PATCH] abf/abf-worker#19: Pass extra params for workers --- app/models/build_list.rb | 7 ++-- app/models/product_build_list.rb | 7 ++-- .../build_lists_publish_task_manager.rb | 36 ++++++++++++------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 313041373..603e1bba8 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -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? { :id => id, - :arch => arch.name, :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, :git_project_address => git_project_address, :commit_hash => commit_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} } end diff --git a/app/models/product_build_list.rb b/app/models/product_build_list.rb index 08cc79bb7..20fc1e689 100644 --- a/app/models/product_build_list.rb +++ b/app/models/product_build_list.rb @@ -168,8 +168,11 @@ class ProductBuildList < ActiveRecord::Base :params => params, :time_living => time_living, :main_script => main_script, - :arch => arch.name, - :distrib_type => product.platform.distrib_type, + :platform => { + :type => product.platform.distrib_type, + :name => product.platform.name, + :arch => arch.name + }, :user => {:uname => user.try(:uname), :email => user.try(:email)} } end diff --git a/lib/abf_worker/build_lists_publish_task_manager.rb b/lib/abf_worker/build_lists_publish_task_manager.rb index d6eb11df0..385f1195c 100644 --- a/lib/abf_worker/build_lists_publish_task_manager.rb +++ b/lib/abf_worker/build_lists_publish_task_manager.rb @@ -110,10 +110,13 @@ module AbfWorker 'class' => 'AbfWorker::PublishWorkerDefault', 'args' => [{ :id => build_list.id, - :arch => build_list.arch.name, - :distrib_type => distrib_type, :cmd_params => cmd_params, - :platform => {:platform_path => platform_path}, + :platform => { + :platform_path => platform_path, + :type => build_list.build_for_platform.distrib_type, + :name => build_list.build_for_platform.name, + :arch => build_list.arch.name + }, :repository => {:id => build_list.save_to_repository_id}, :type => :publish, :time_living => 9600, # 160 min @@ -191,10 +194,13 @@ module AbfWorker 'class' => "AbfWorker::PublishWorkerDefault", 'args' => [{ :id => r.id, - :arch => 'x86_64', - :distrib_type => distrib_type, :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}, :type => :resign, :skip_feedback => true, @@ -301,10 +307,13 @@ module AbfWorker lock_str = "#{save_to_repository_id}-#{build_for_platform_id}" options = { :id => (bl ? bl.id : Time.now.to_i), - :arch => (bl ? bl.arch.name : 'x86_64'), - :distrib_type => distrib_type, :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}, :type => :publish, :time_living => 9600, # 160 min @@ -369,10 +378,13 @@ module AbfWorker options = { :id => Time.now.to_i, - :arch => 'x86_64', - :distrib_type => build_for_platform.distrib_type, :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}, :type => :publish, :time_living => 9600, # 160 min