summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-04-19 07:39:02 -0700
committerGitHub <noreply@github.com>2021-04-19 07:39:02 -0700
commit3f19dc12bf85cf8b31b35111c61b869664ed717e (patch)
treea3ca2f366fa013b385724de4ca15097a2b1e3ba0
parent6f4ab13280bb9456828aa97a54009b9c1fb2350a (diff)
parentf1c3d6846a4ea77e03c0bfea06c4e9fae1c17a36 (diff)
downloadchef-3f19dc12bf85cf8b31b35111c61b869664ed717e.tar.gz
Merge pull request #11384 from chef/nkierpiec/update-omnibus-tests-chef-15
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--omnibus/omnibus-test.ps113
-rw-r--r--omnibus/omnibus-test.sh7
2 files changed, 17 insertions, 3 deletions
diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1
index d5fb9c7bcd..726ea2f231 100644
--- a/omnibus/omnibus-test.ps1
+++ b/omnibus/omnibus-test.ps1
@@ -10,8 +10,17 @@ If ([string]::IsNullOrEmpty($product)) { $product = "chef" }
$version = "$Env:VERSION"
If ([string]::IsNullOrEmpty($version)) { $version = "latest" }
-Write-Output "--- Installing $channel $product $version"
-$package_file = $(C:\opscode\omnibus-toolchain\bin\install-omnibus-product.ps1 -Product "$product" -Channel "$channel" -Version "$version" | Select-Object -Last 1)
+$package_file = "$Env:PACKAGE_FILE"
+If ([string]::IsNullOrEmpty($package_file)) { $package_file = "" }
+
+If ($package_file -eq "") {
+ Write-Output "--- Installing $channel $product $version"
+ $package_file = $(.omnibus-buildkite-plugin\install-omnibus-product.ps1 -Product "$product" -Channel "$channel" -Version "$version" | Select-Object -Last 1)
+}
+Else {
+ Write-Output "--- Installing $product $version"
+ $package_file = $(.omnibus-buildkite-plugin\install-omnibus-product.ps1 -Package "$package_file" -Product "$product" -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"
diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh
index 0499d03b0b..f18020ddac 100644
--- a/omnibus/omnibus-test.sh
+++ b/omnibus/omnibus-test.sh
@@ -4,11 +4,16 @@ set -ueo pipefail
channel="${CHANNEL:-unstable}"
product="${PRODUCT:-chef}"
version="${VERSION:-latest}"
+package_file=${PACKAGE_FILE:-""}
export INSTALL_DIR="/opt/$product"
echo "--- Installing $channel $product $version"
-package_file="$("/opt/$TOOLCHAIN/bin/install-omnibus-product" -c "$channel" -P "$product" -v "$version" | tail -1)"
+if [[ -z $package_file ]]; then
+ package_file="$(.omnibus-buildkite-plugin/install-omnibus-product.sh -c "$channel" -P "$product" -v "$version" | tail -1)"
+else
+ .omnibus-buildkite-plugin/install-omnibus-product.sh -f "$package_file" -P "$product" -v "$version" &> /dev/null
+fi
echo "--- Verifying omnibus package is signed"
"/opt/$TOOLCHAIN/bin/check-omnibus-package-signed" "$package_file"