mirror of
https://github.com/adammck/terraform-inventory
synced 2024-11-22 07:32:03 +01:00
Add bin/dist
To build packages for many targets.
This commit is contained in:
parent
726c235914
commit
517a54538d
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/terraform-inventory
|
||||
/fixtures/secrets.tfvars
|
||||
/pkg/*.zip
|
||||
/terraform-inventory
|
||||
|
29
bin/dist
Executable file
29
bin/dist
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash -e
|
||||
cd $(cd `dirname "$0"`; cd ..; pwd)
|
||||
|
||||
VERSION=$1
|
||||
if [ -z $VERSION ]; then
|
||||
echo "Error: VERSION must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGETS="darwin_386 darwin_amd64 linux_386 linux_amd64 linux_arm windows_386 windows_amd64"
|
||||
|
||||
for target in $TARGETS; do
|
||||
t=(${target//_/ })
|
||||
|
||||
export GOOS=${t[0]}
|
||||
export GOARCH=${t[1]}
|
||||
export NAME=terraform-inventory
|
||||
|
||||
if [ $GOOS == "windows" ]; then
|
||||
NAME=${NAME}.exe
|
||||
fi
|
||||
|
||||
go build -v -o pkg/${NAME}
|
||||
|
||||
pushd pkg
|
||||
zip terraform-inventory_${VERSION}_${GOOS}_${GOARCH}.zip ${NAME}
|
||||
rm ${NAME}
|
||||
popd
|
||||
done
|
0
pkg/.gitkeep
Normal file
0
pkg/.gitkeep
Normal file
Loading…
Reference in New Issue
Block a user