2019-04-04 12:26:17 -04:00
|
|
|
# Stop script execution when a non-terminating error occurs
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
|
|
$channel = "$Env:CHANNEL"
|
|
|
|
If ([string]::IsNullOrEmpty($channel)) { $channel = "unstable" }
|
|
|
|
|
|
|
|
$product = "$Env:PRODUCT"
|
|
|
|
If ([string]::IsNullOrEmpty($product)) { $product = "inspec" }
|
|
|
|
|
|
|
|
$version = "$Env:VERSION"
|
|
|
|
If ([string]::IsNullOrEmpty($version)) { $version = "latest" }
|
|
|
|
|
|
|
|
Write-Output "--- Installing $channel $product $version"
|
2019-06-20 00:45:52 -04:00
|
|
|
$package_file = $(C:\opscode\omnibus-toolchain\bin\install-omnibus-product.ps1 -Product "$product" -Channel "$channel" -Version "$version" | Select-Object -Last 1)
|
|
|
|
|
|
|
|
Write-Output "--- Verifying omnibus package is signed"
|
|
|
|
C:\opscode\omnibus-toolchain\bin\check-omnibus-package-signed.ps1 "$package_file"
|
2019-04-04 12:26:17 -04:00
|
|
|
|
2019-05-15 23:22:26 -04:00
|
|
|
Write-Output "--- Running verification for $channel $product $version"
|
2019-04-04 12:26:17 -04:00
|
|
|
|
2019-04-12 03:53:16 -04:00
|
|
|
# reload Env:PATH to ensure it gets any changes that the install made (e.g. C:\opscode\inspec\bin\ )
|
|
|
|
$Env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
|
|
|
2019-11-12 12:47:40 -08:00
|
|
|
Write-Host "--- Downloading Ruby + DevKit"
|
|
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
2020-02-05 10:26:24 -08:00
|
|
|
(New-Object System.Net.WebClient).DownloadFile('https://public-cd-buildkite-cache.s3-us-west-2.amazonaws.com/rubyinstaller-devkit-2.6.5-1-x64.exe', 'c:\\rubyinstaller-devkit-2.6.5-1-x64.exe')
|
2019-04-04 12:26:17 -04:00
|
|
|
|
2019-11-12 12:47:40 -08:00
|
|
|
Write-Host "--- Installing Ruby + DevKit"
|
|
|
|
Start-Process c:\rubyinstaller-devkit-2.6.5-1-x64.exe -ArgumentList '/verysilent /dir=C:\\ruby26' -Wait
|
2019-07-09 19:09:29 -07:00
|
|
|
|
2019-11-12 12:47:40 -08:00
|
|
|
Write-Host "--- Cleaning up installation"
|
|
|
|
Remove-Item c:\rubyinstaller-devkit-2.6.5-1-x64.exe -Force
|
2019-07-09 19:09:29 -07:00
|
|
|
|
2019-11-12 12:47:40 -08:00
|
|
|
$Env:Path += ";C:\ruby26\bin"
|
|
|
|
Write-Host "+++ Testing $Plan"
|
|
|
|
|
|
|
|
cd test/artifact
|
|
|
|
rake
|