Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.so
*.dylib
terrafile
output

# Test binary, build with `go test -c`
*.test
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
release:
./scripts/binary-release.sh
30 changes: 30 additions & 0 deletions scripts/binary-release.sh
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