diff --git a/app/models/concerns/product_build_lists/abf_workerable.rb b/app/models/concerns/product_build_lists/abf_workerable.rb
index e9b01eb90..4c9c2abe4 100644
--- a/app/models/concerns/product_build_lists/abf_workerable.rb
+++ b/app/models/concerns/product_build_lists/abf_workerable.rb
@@ -34,27 +34,10 @@ module ProductBuildLists::AbfWorkerable
end
def abf_worker_args
- file_name = "#{project.name}-#{commit_hash}"
- opts = default_url_options
- opts.merge!({user: user.authentication_token, password: ''}) if user.present?
- srcpath = url_helpers.archive_url(
- project.name_with_owner,
- file_name,
- 'tar.gz',
- opts
- )
-
- cmd_params = "BUILD_ID=#{id} "
- if product.platform.hidden?
- token = product.platform.tokens.by_active.where(description: CACHED_CHROOT_TOKEN_DESCRIPTION).first
- cmd_params << "TOKEN=#{token.authentication_token} " if token
- end
- cmd_params << params.to_s
-
{
- id: id,
- srcpath: srcpath,
- params: cmd_params,
+ id: id,
+ srcpath: abf_worker_srcpath,
+ params: abf_worker_params,
time_living: time_living,
main_script: main_script,
platform: {
@@ -66,4 +49,36 @@ module ProductBuildLists::AbfWorkerable
}
end
+ # Private: Get URL to project archive.
+ #
+ # Returns the String.
+ def abf_worker_srcpath
+ file_name = "#{project.name}-#{commit_hash}"
+ opts = default_url_options
+ opts.merge!({user: user.authentication_token, password: ''}) if user.present?
+ url_helpers.archive_url(
+ project.name_with_owner,
+ file_name,
+ 'tar.gz',
+ opts
+ )
+ end
+
+ # Private: Get params for ABF worker task.
+ #
+ # Returns the String with space separated params.
+ def abf_worker_params
+ p = {
+ 'BUILD_ID' => id,
+ 'PROJECT' => project.name_with_owner,
+ 'PROJECT_VERSION' => project_version,
+ 'COMMIT_HASH' => commit_hash,
+ }
+ if product.platform.hidden?
+ token = product.platform.tokens.by_active.where(description: CACHED_CHROOT_TOKEN_DESCRIPTION).first
+ p.merge!('TOKEN' => token.authentication_token) if token
+ end
+ p.map{ |k, v| "#{k}=#{v}" } * ' ' + ' ' + params.to_s
+ end
+
end
diff --git a/config/locales/models/product_build_list.en.yml b/config/locales/models/product_build_list.en.yml
index d5e3bfd79..cc775e3eb 100644
--- a/config/locales/models/product_build_list.en.yml
+++ b/config/locales/models/product_build_list.en.yml
@@ -69,3 +69,17 @@ en:
status: Select a status
product_name: Enter the name of product here.
product_id: Enter the ID of product build list here.
+ params: "ARCH=x86_64"
+ hints:
+ product_build_list:
+ params_html: >
+ Enter above a params which will be used for running of Main script.
+
+ By default passes next params:
+