@@ -27,7 +27,29 @@ def fetch_build_details(sha_yaml_url)
2727 return sha_yaml_folder_url , file_hash [ :platform_data ]
2828 end
2929
30- # gets the artifact & repo_config URLs for this host in the build
30+ # Get the host's packaging platform, based on beaker-hostgenerator's
31+ # osinfo hash and the environment. Set ENV['BEAKER_PACKAGING_PLATFORMS']
32+ # to override the default packaging platform specified by
33+ # beaker-hostgenerator. This should be a comma-separated string with
34+ # entries of the format `<host-platform>=<override-platform>`
35+ #
36+ # @param [Host] host Host whose packaging platform to determine
37+ # @return [String] The packaging platform
38+ def host_packaging_platform ( host )
39+ packaging_platform = host [ :packaging_platform ]
40+ if ENV [ 'BEAKER_PACKAGING_PLATFORMS' ]
41+ overrides = Hash [ ENV [ 'BEAKER_PACKAGING_PLATFORMS' ] . split ( ',' ) . map { |e | e . split ( '=' ) } ]
42+ logger . debug ( "Found packaging platform overrides: #{ overrides } " )
43+ if overrides [ host [ :platform ] ]
44+ platform = overrides [ host [ :platform ] ]
45+ logger . debug ( "Default beaker packaging platform '#{ host [ :packaging_platform ] } ' for '#{ host [ :platform ] } ' overridden as '#{ platform } '" )
46+ packaging_platform = platform
47+ end
48+ end
49+ packaging_platform
50+ end
51+
52+ # Gets the artifact & repo_config URLs for this host in the build.
3153 #
3254 # @param [Host] host Host to get artifact URL for
3355 # @param [Hash] build_details Details of the build in a hash
@@ -36,7 +58,7 @@ def fetch_build_details(sha_yaml_url)
3658 # @return [String, String] URL to the build artifact, URL to the repo_config
3759 # (nil if there is no repo_config for this platform for this build)
3860 def host_urls ( host , build_details , build_url )
39- packaging_platform = host [ :packaging_platform ]
61+ packaging_platform = host_packaging_platform ( host )
4062 if packaging_platform . nil?
4163 message = <<-EOF
4264 :packaging_platform not provided for host '#{ host } ', platform '#{ host [ :platform ] } '
0 commit comments