Merge pull request #4157 from inspec/snappj/minor-improvements-to-omnibus-test-scripts

Minor changes to omnibus-test scripts
This commit is contained in:
Miah Johnson 2019-05-29 14:09:59 -07:00 committed by GitHub
commit ddd6f354ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View file

@ -10,8 +10,17 @@ If ([string]::IsNullOrEmpty($product)) { $product = "inspec" }
$version = "$Env:VERSION"
If ([string]::IsNullOrEmpty($version)) { $version = "latest" }
. C:\buildkite-agent\bin\load-omnibus-toolchain.ps1
If ($env:OMNIBUS_WINDOWS_ARCH -eq "x86") {
$architecture = "i386"
}
ElseIf ($env:OMNIBUS_WINDOWS_ARCH -eq "x64") {
$architecture = "x86_64"
}
Write-Output "--- Downloading $channel $product $version"
$download_url = C:\opscode\omnibus-toolchain\embedded\bin\mixlib-install.bat download --url --channel "$channel" "$product" --version "$version"
$download_url = C:\opscode\omnibus-toolchain\embedded\bin\mixlib-install.bat download --url --channel "$channel" "$product" --version "$version" --architecture "$architecture"
$package_file = "$Env:Temp\$(Split-Path -Path $download_url -Leaf)"
Invoke-WebRequest -OutFile "$package_file" -Uri "$download_url"
@ -27,9 +36,7 @@ Else {
Write-Output "--- Installing $channel $product $version"
Start-Process "$package_file" /quiet -Wait
Write-Output "--- Testing $channel $product $version"
Write-Output "Running verification for $product"
Write-Output "--- Running verification for $channel $product $version"
# 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")

View file

@ -11,9 +11,7 @@ package_file="$(install-omnibus-product -c "$channel" -P "$product" -v "$version
echo "--- Verifying omnibus package is signed"
check-omnibus-package-signed "$package_file"
echo "--- Testing $channel $product $version"
echo "Verifying ownership of package files"
echo "--- Verifying ownership of package files"
export INSTALL_DIR=/opt/inspec
NONROOT_FILES="$(find "$INSTALL_DIR" ! -uid 0 -print)"
@ -25,7 +23,7 @@ else
exit 1
fi
echo "Running verification for $product"
echo "--- Running verification for $channel $product $version"
# Set GEM_HOME and GEM_PATH to verify our appbundle inspec shim is correctly
# removing them from the environment while launching from our embedded ruby.