lib/beaker/host/windows/pkg.rb in beaker-2.34.0 vs lib/beaker/host/windows/pkg.rb in beaker-2.35.0

- old
+ new

@@ -45,9 +45,53 @@ #@return [Boolean] true if x86_64, false otherwise def determine_if_x86_64 (identify_windows_architecture =~ /64/) == 0 end + # Gets the path & file name for the puppet agent dev package on Windows + # + # @param [String] puppet_collection Name of the puppet collection to use + # @param [String] puppet_agent_version Version of puppet agent to get + # @param [Hash{Symbol=>String}] opts Options hash to provide extra values + # + # @note Windows only uses the 'install_32' option of the opts hash at this + # time. Note that it will not fail if not provided, however + # + # @return [String, String] Path to the directory and filename of the package, respectively + def puppet_agent_dev_package_info( puppet_collection = nil, puppet_agent_version = nil, opts = {} ) + release_path_end = 'windows' + is_config_32 = self['ruby_arch'] == 'x86' || self['install_32'] || opts['install_32'] + should_install_64bit = self.is_x86_64? && !is_config_32 + # only install 64bit builds if + # - we do not have install_32 set on host + # - we do not have install_32 set globally + arch_suffix = should_install_64bit ? '64' : '86' + release_file = "puppet-agent-x#{arch_suffix}.msi" + return release_path_end, release_file + end + + # Gets host-specific information for PE promoted puppet-agent packages + # + # @param [String] puppet_collection Name of the puppet collection to use + # @param [Hash{Symbol=>String}] opts Options hash to provide extra values + # + # @return [String, String, String] Host-specific information for packages + # 1. release_path_end Suffix for the release_path + # 2. release_file Path to the file on release build servers + # 3. download_file Filename for the package itself + def pe_puppet_agent_promoted_package_info( puppet_collection = nil, opts = {} ) + is_config_32 = self['ruby_arch'] == 'x86' || self['install_32'] || self['install_32'] + should_install_64bit = self.is_x86_64? && !is_config_32 + # only install 64bit builds if + # - we do not have install_32 set on host + # - we do not have install_32 set globally + arch_suffix = should_install_64bit ? '64' : '86' + release_path_end = "/windows" + release_file = "/puppet-agent-x#{arch_suffix}.msi" + download_file = "puppet-agent-x#{arch_suffix}.msi" + return release_path_end, release_file, download_file + end + private # @api private def identify_windows_architecture arch = nil