forked from coretech/terrafile
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a release script to build linux packages (#3)
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
*.so | ||
*.dylib | ||
terrafile | ||
output | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
release: | ||
./scripts/binary-release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# clean up | ||
echo "-> running clean up...." | ||
rm -rf output/* | ||
|
||
# install gox | ||
if ! which gox > /dev/null; then | ||
echo "-> installing gox..." | ||
go get -u github.com/mitchellh/gox | ||
fi | ||
|
||
# build | ||
echo "-> building..." | ||
gox \ | ||
-os="linux" \ | ||
-arch="amd64" \ | ||
-output "output/{{.OS}}_{{.Arch}}/terrafile" \ | ||
. | ||
|
||
# Zip and copy to the dist dir | ||
echo "" | ||
echo "Packaging..." | ||
for PLATFORM in $(find ./output -mindepth 1 -maxdepth 1 -type d); do | ||
OSARCH=$(basename ${PLATFORM}) | ||
echo "--> ${OSARCH}" | ||
|
||
pushd $PLATFORM >/dev/null 2>&1 | ||
zip ../terrafile_${OSARCH}.zip ./* | ||
done |