diff --git a/coin/provisioning/common/helpers.ps1 b/coin/provisioning/common/helpers.ps1 index d7b957f3..055ce0a7 100644 --- a/coin/provisioning/common/helpers.ps1 +++ b/coin/provisioning/common/helpers.ps1 @@ -29,3 +29,23 @@ function Extract-Zip $destinationFolder = $shell.Namespace($Destination) $destinationFolder.CopyHere($zipfile.Items(), 16) } + +function BadParam +{ + Param ([string]$Description) + throw("You must specify $Description") +} + +function Download +{ + Param ( + [string] $OfficialUrl = $(BadParam("the official download URL")), + [string] $CachedUrl = $(BadParam("the locally cached URL")), + [string] $Destination = $(BadParam("a download target location")) + ) + try { + Invoke-WebRequest -UseBasicParsing $CachedUrl -OutFile $Destination + } catch { + Invoke-WebRequest -UseBasicParsing $OfficialUrl -OutFile $Destination + } +} diff --git a/coin/provisioning/common/ruby.ps1 b/coin/provisioning/common/ruby.ps1 new file mode 100644 index 00000000..343bacfc --- /dev/null +++ b/coin/provisioning/common/ruby.ps1 @@ -0,0 +1,7 @@ +. "$PSScriptRoot\helpers.ps1" + +$installer = "c:\users\qt\downloads\rubyinstaller-2.3.1.exe" + +Download https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.1.exe http://ci-files01-hki.ci.local/input/ruby/rubyinstaller-2.3.1.exe $installer +Verify-Checksum $installer "FF377F6F313849C3B0CD72EEC1EFFA436F0E4A36" +& $installer /DIR=C:\ruby /VERYSILENT diff --git a/coin/provisioning/qtci-windows-10-x86/ruby.ps1 b/coin/provisioning/qtci-windows-10-x86/ruby.ps1 new file mode 100644 index 00000000..587a4c10 --- /dev/null +++ b/coin/provisioning/qtci-windows-10-x86/ruby.ps1 @@ -0,0 +1 @@ +. "$PSScriptRoot\..\common\ruby.ps1" diff --git a/coin/provisioning/qtci-windows-10-x86_64/ruby.ps1 b/coin/provisioning/qtci-windows-10-x86_64/ruby.ps1 new file mode 100644 index 00000000..587a4c10 --- /dev/null +++ b/coin/provisioning/qtci-windows-10-x86_64/ruby.ps1 @@ -0,0 +1 @@ +. "$PSScriptRoot\..\common\ruby.ps1"