2019-04-04 16:26:17 +00: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 04:45:52 +00: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 16:26:17 +00:00
|
|
|
|
2019-05-16 03:22:26 +00:00
|
|
|
Write-Output "--- Running verification for $channel $product $version"
|
2019-04-04 16:26:17 +00:00
|
|
|
|
2019-04-12 07:53:16 +00: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")
|
|
|
|
|
2020-04-06 20:06:21 +00:00
|
|
|
$Env:Path = "C:\opscode\$product\bin;C:\opscode\$product\embedded\bin;$Env:PATH"
|
2019-11-12 20:47:40 +00:00
|
|
|
Write-Host "+++ Testing $Plan"
|
|
|
|
|
2020-04-06 20:06:21 +00:00
|
|
|
Set-Location test/artifact
|
2019-11-12 20:47:40 +00:00
|
|
|
rake
|
2020-04-06 20:06:21 +00:00
|
|
|
If ($lastexitcode -ne 0) { Exit $lastexitcode }
|