summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeha Pansare <neha.pansare@progress.com>2023-02-08 15:34:17 +0530
committerNeha Pansare <neha.pansare@progress.com>2023-02-14 19:10:43 +0530
commit7e2ef5a4b98917061f963ad44b2dbbbd65ac9ca2 (patch)
treee82e2c2013db5198c1b25aec3035fc4e9870df59
parentea5ee1d54abae873a1f60427fcfe5ae3f93a9fbd (diff)
downloadchef-7e2ef5a4b98917061f963ad44b2dbbbd65ac9ca2.tar.gz
Use the artifact parameter passed to the script instead of env variable
Signed-off-by: Neha Pansare <neha.pansare@progress.com>
-rw-r--r--.expeditor/habitat-test.pipeline.yml3
-rw-r--r--.expeditor/scripts/ensure-minimum-viable-hab.ps14
-rw-r--r--.expeditor/scripts/habitat-test.ps19
3 files changed, 7 insertions, 9 deletions
diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml
index 836f9c91f4..1df53a8d59 100644
--- a/.expeditor/habitat-test.pipeline.yml
+++ b/.expeditor/habitat-test.pipeline.yml
@@ -8,7 +8,6 @@ expeditor:
limit: 1
steps:
-
- label: ":linux: Validate Linux"
commands:
- sudo ./.expeditor/scripts/install-hab.sh x86_64-linux
@@ -35,7 +34,7 @@ steps:
- label: ":windows: Validate Habitat Builds of Chef Infra"
commands:
- - .expeditor/scripts/habitat-test.ps1 $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
+ - .expeditor/scripts/habitat-test.ps1 -WindowsArtifact $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
expeditor:
executor:
windows:
diff --git a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 b/.expeditor/scripts/ensure-minimum-viable-hab.ps1
index 5d1bf1f54b..44fdd79548 100644
--- a/.expeditor/scripts/ensure-minimum-viable-hab.ps1
+++ b/.expeditor/scripts/ensure-minimum-viable-hab.ps1
@@ -16,6 +16,4 @@ catch {
Write-Host "--- :habicat: Installing the version of Habitat required"
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1'))
-}
-Write-Host "--- :habicat: Refreshing the Path"
-$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") + ";C:\ProgramData\Habitat;"
+} \ No newline at end of file
diff --git a/.expeditor/scripts/habitat-test.ps1 b/.expeditor/scripts/habitat-test.ps1
index 824cbf94b5..0dbcf3e4af 100644
--- a/.expeditor/scripts/habitat-test.ps1
+++ b/.expeditor/scripts/habitat-test.ps1
@@ -1,15 +1,16 @@
+param ($WindowsArtifact = $(throw "WindowsArtifact parameter is required."))
$ErrorActionPreference = 'Stop'
$ScriptRoute = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, "ensure-minimum-viable-hab.ps1"))
& "$ScriptRoute"
# . ./scripts/ensure-minimum-viable-hab.ps1
-Write-Host "--- Installing $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS"
+Write-Host "--- Installing $WindowsArtifact"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
-hab pkg install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
+hab pkg install $WindowsArtifact
-if (-not $?) { throw "Unable to install $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS" }
+if (-not $?) { throw "Unable to install $WindowsArtifact" }
-. ./habitat/tests/test.ps1 -PackageIdentifier $EXPEDITOR_PKG_IDENTS_CHEFINFRACLIENTX86_64WINDOWS
+. ./habitat/tests/test.ps1 -PackageIdentifier $WindowsArtifact
if (-not $?) { throw "Habitat tests failed" }