lib/beaker/dsl/install_utils.rb in beaker-2.3.0 vs lib/beaker/dsl/install_utils.rb in beaker-2.4.0

- old
+ new

@@ -24,11 +24,11 @@ # Github's ssh signature for cloning via ssh GitHubSig = 'github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' # The directories in the module directory that will not be scp-ed to the test system when using `copy_module_to` - PUPPET_MODULE_INSTALL_IGNORE = ['.bundle', '.git', '.idea', '.vagrant', '.vendor', 'vendor', 'acceptance', 'spec', 'tests', 'log'] + PUPPET_MODULE_INSTALL_IGNORE = ['.bundle', '.git', '.idea', '.vagrant', '.vendor', 'vendor', 'acceptance', 'bundle', 'spec', 'tests', 'log'] # @param [String] uri A uri in the format of <git uri>#<revision> # the `git://`, `http://`, `https://`, and ssh # (if cloning as the remote git user) protocols # are valid for <git uri> @@ -803,17 +803,31 @@ end link = "#{opts[:win_download_url]}/#{host['dist']}.msi" if not link_exists?( link ) raise "Puppet #{version} at #{link} does not exist!" end - on host, "curl -O #{link}" - on host, "msiexec /qn /i #{host['dist']}.msi" - #Because the msi installer doesn't add Puppet to the environment path - #Add both potential paths for simplicity - #NOTE - this is unnecessary if the host has been correctly identified as 'foss' during set up - puppetbin_path = "\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"" - on host, %Q{ echo 'export PATH=$PATH:#{puppetbin_path}' > /etc/bash.bashrc } + if host['is_cygwin'].nil? or host['is_cygwin'] == true + dest = "/cygdrive/c/Windows/Temp/#{host['dist']}.msi" + on host, "curl -O #{dest} #{link}" + + #Because the msi installer doesn't add Puppet to the environment path + #Add both potential paths for simplicity + #NOTE - this is unnecessary if the host has been correctly identified as 'foss' during set up + puppetbin_path = "\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"" + on host, %Q{ echo 'export PATH=$PATH:#{puppetbin_path}' > /etc/bash.bashrc } + else + dest = "C:\\Windows\\Temp\\#{host['dist']}.msi" + + on host, "set PATH=\"%PATH%;#{host['puppetbindir']}\"" + on host, "setx PATH \"%PATH%;#{host['puppetbindir']}\"" + + on host, powershell("$webclient = New-Object System.Net.WebClient; $webclient.DownloadFile('#{link}','#{dest}')") + + on host, "if not exist #{host['distmoduledir']} (md #{host['distmoduledir']})" + end + + on host, "msiexec /qn /i #{dest}" end # Installs Puppet and dependencies from dmg # # @param [Host] host The host to install packages on