copy paste plan.sh -> plan.ps1 and change for Powershell

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-07-10 21:53:55 -07:00
parent 5e699d2fb3
commit 01bea50c43

56
habitat/plan.ps1 Normal file
View file

@ -0,0 +1,56 @@
$pkg_name="inspec"
$pkg_origin="chef"
$pkg_version=$(cat "$PLAN_CONTEXT/../VERSION")
$pkg_description="InSpec is an open-source testing framework for infrastructure
with a human- and machine-readable language for specifying compliance,
security and policy requirements."
$pkg_upstream_url="https://www.inspec.io/"
$pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
$pkg_license=('Apache-2.0')
$pkg_deps=@(
"core/coreutils",
"core/cacerts",
"core/git",
"core/ruby",
"core/bash"
)
$pkg_build_deps=@(
"core/gcc",
"core/make",
"core/readline",
"core/sed"
)
$pkg_bin_dirs=@("bin")
do_setup_environment() {
build_line 'Setting GEM_HOME="$pkg_prefix/lib"'
export GEM_HOME="$pkg_prefix/lib"
build_line "Setting GEM_PATH=$GEM_HOME"
export GEM_PATH="$GEM_HOME"
}
function Invoke-Unpack {
mkdir "$HAB_CACHE_SRC_PATH/$pkg_dirname"
Copy-Item "$PLAN_CONTEXT"/.. "$HAB_CACHE_SRC_PATH/$pkg_dirname/" -Recurse
}
function Invoke-Build {
Push-Location "$HAB_CACHE_SRC_PATH/$pkg_dirname/"
gem build inspec.gemspec
Pop-Location
Push-Location "$HAB_CACHE_SRC_PATH/$pkg_dirname/inspec-bin"
gem build inspec-bin.gemspec
Pop-Location
}
function Invoke-Install {
# MUST install inspec first because inspec-bin depends on it via gemspec
Push-Location "$HAB_CACHE_SRC_PATH/$pkg_dirname/"
gem install inspec-*.gem --no-document
Pop-Location
Push-Location "$HAB_CACHE_SRC_PATH/$pkg_dirname/inspec-bin"
gem install inspec-bin*.gem --no-document
Pop-Location
}