diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/ci/ensure-minimum-viable-hab.ps1 | 9 | ||||
-rw-r--r-- | scripts/ci/verify-plan.ps1 | 12 |
2 files changed, 11 insertions, 10 deletions
diff --git a/scripts/ci/ensure-minimum-viable-hab.ps1 b/scripts/ci/ensure-minimum-viable-hab.ps1 new file mode 100644 index 0000000000..175c7d4890 --- /dev/null +++ b/scripts/ci/ensure-minimum-viable-hab.ps1 @@ -0,0 +1,9 @@ +$hab_version = (hab --version) +$hab_minor_version = $hab_version.split('.')[1] +if ( -not $? -Or $hab_minor_version -lt 85 ) { + Write-Host "--- :habicat: Installing the version of Habitat required" + install-habitat --version 0.85.0.20190916 + if (-not $?) { throw "Hab version is older than 0.85 and could not update it." } +} else { + Write-Host "--- :habicat: :thumbsup: Minimum required version of Habitat already installed" +} diff --git a/scripts/ci/verify-plan.ps1 b/scripts/ci/verify-plan.ps1 index d65f592e9f..bf206fab9c 100644 --- a/scripts/ci/verify-plan.ps1 +++ b/scripts/ci/verify-plan.ps1 @@ -12,20 +12,12 @@ $Plan = 'chef-infra-client' Write-Host "--- :8ball: :windows: Verifying $Plan" -$hab_version = (hab --version) -$hab_minor_version = $hab_version.split('.')[1] -if ( -not $? -Or $hab_minor_version -lt 85 ) { - Write-Host "--- :habicat: Installing the version of Habitat required" - install-habitat --version 0.85.0.20190916 -} else { - Write-Host "--- :habicat: :thumbsup: Minimum required version of Habitat already installed" -} - +powershell -File "./scripts/ci/ensure-minimum-viable-hab.ps1" +if (-not $?) { throw "Could not ensure the minimum hab version required is installed." } Write-Host "--- :key: Generating fake origin key" hab origin key generate $env:HAB_ORIGIN - $project_root = "$(git rev-parse --show-toplevel)" Set-Location $project_root |