2019-10-17 02:57:45 +00:00
|
|
|
#!/usr/bin/env powershell
|
|
|
|
|
|
|
|
#Requires -Version 5
|
|
|
|
|
|
|
|
$env:HAB_ORIGIN = 'ci'
|
2019-10-21 21:46:04 +00:00
|
|
|
$env:CHEF_LICENSE = 'accept-no-persist'
|
2019-10-21 23:16:37 +00:00
|
|
|
$env:HAB_LICENSE = 'accept-no-persist'
|
2019-10-17 02:57:45 +00:00
|
|
|
$Plan = 'inspec'
|
|
|
|
|
|
|
|
Write-Host "--- system details"
|
|
|
|
$Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture'
|
|
|
|
Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize
|
|
|
|
|
|
|
|
Write-Host "--- Installing the version of Habitat required"
|
|
|
|
Install-Habitat --version 0.85.0.20190916
|
|
|
|
|
|
|
|
Write-Host "--- Generating fake origin key"
|
|
|
|
hab origin key generate $env:HAB_ORIGIN
|
|
|
|
|
|
|
|
Write-Host "--- Building $Plan"
|
|
|
|
$project_root = "$(git rev-parse --show-toplevel)"
|
|
|
|
Set-Location $project_root
|
|
|
|
|
|
|
|
$env:DO_CHECK=$true; hab pkg build .
|
|
|
|
if (-not $?) { throw "unable to build" }
|
|
|
|
|
2019-10-22 19:23:31 +00:00
|
|
|
. $project_root/results/last_build.ps1
|
2019-10-17 02:57:45 +00:00
|
|
|
if (-not $?) { throw "unable to determine details about this build" }
|
|
|
|
|
|
|
|
Write-Host "--- Installing $pkg_ident"
|
2019-10-22 19:23:31 +00:00
|
|
|
hab pkg install $project_root/results/$pkg_artifact
|
2019-10-17 02:57:45 +00:00
|
|
|
if (-not $?) { throw "unable to install this build" }
|
|
|
|
|
|
|
|
Write-Host "+++ Testing $Plan"
|
|
|
|
Push-Location $project_root/test/artifact
|
|
|
|
rake
|
|
|
|
if (-not $?) { throw "rake failed" }
|
|
|
|
Pop-Location
|