Skip to content

Commit

Permalink
feat: Add build script for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Hattori committed Jul 18, 2018
1 parent fbb7de6 commit 85c65a5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
33 changes: 33 additions & 0 deletions build.sh
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

0 comments on commit 85c65a5

Please sign in to comment.