-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ross Hattori
committed
Jul 18, 2018
1 parent
fbb7de6
commit 85c65a5
Showing
2 changed files
with
34 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
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,33 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
IFS=$' \n\t' | ||
|
||
export PROVIDER_VERSION="0.0.3" | ||
export DISTDIR="$PWD/dist" | ||
export WORKDIR="$PWD" | ||
|
||
export GOX_MAIN_TEMPLATE="$DISTDIR/{{.OS}}/{{.Dir}}_v${PROVIDER_VERSION}" | ||
export GOX_ARCH="amd64" | ||
export GOX_OS=${*:-"linux darwin"} | ||
|
||
# We'll use gox to cross-compile | ||
go get github.com/mitchellh/gox | ||
# We just assume the cross toolchains are already installed, since on Debian | ||
# there are deb packages for those. | ||
|
||
# Build the provider | ||
gox -arch="$GOX_ARCH" -os="$GOX_OS" -output="$GOX_MAIN_TEMPLATE" github.com/saymedia/terraform-buildkite/terraform-provider-buildkite | ||
|
||
# ZZZZZZZZZZZZZZZZZZZZIPPIT | ||
echo "--- Build done" | ||
for os in $GOX_OS; do | ||
for arch in $GOX_ARCH; do | ||
echo "--- Zipping $os/$arch" | ||
cd "$DISTDIR/$os" | ||
zip ../terraform-provider-buildkite-v"${PROVIDER_VERSION}"-"$os"-"$arch".zip ./* | ||
done | ||
done | ||
echo "--- DING! Fries are done" | ||
cd "$DISTDIR" | ||
openssl dgst -r -sha256 ./*.zip > sha256s.txt | ||
exit 0 |