git.iko.soy/typeable/oauth2-proxy
on v1.0 help sign in
30 lines 842 B history raw
1#!/bin/bash
3# build binary distributions for linux/amd64 and darwin/amd64
4set -e
6DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7echo "working dir $DIR"
8mkdir -p $DIR/dist
9mkdir -p $DIR/.godeps
10export GOPATH=$DIR/.godeps:$GOPATH
11gpm install
13os=$(go env GOOS)
14arch=$(go env GOARCH)
15version=$(cat $DIR/version.go | grep "const VERSION" | awk '{print $NF}' | sed 's/"//g')
16goversion=$(go version | awk '{print $3}')
18echo "... running tests"
19./test.sh || exit 1
21for os in linux darwin; do
22 echo "... building v$version for $os/$arch"
23 BUILD=$(mktemp -d -t google_auth_proxy)
24 TARGET="google_auth_proxy-$version.$os-$arch.$goversion"
25 GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/google_auth_proxy || exit 1
26 pushd $BUILD
27 tar czvf $TARGET.tar.gz $TARGET
28 mv $TARGET.tar.gz $DIR/dist
29 popd
30done