2015-08-18 05:57:27 +05:30
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
export GOPATH=${PWD}/Godeps/_workspace
|
|
|
|
export GOBIN=${PWD}/bin
|
|
|
|
|
2015-08-20 04:10:36 +05:30
|
|
|
if command -v go-bindata &>/dev/null; then
|
|
|
|
DEX_MIGRATE_FROM_DISK=${DEX_MIGRATE_FROM_DISK:=false}
|
|
|
|
|
|
|
|
echo "Turning migrations into ./db/migrations/assets.go"
|
|
|
|
if [ "$DEX_MIGRATE_FROM_DISK" = true ]; then
|
|
|
|
echo "Compiling migrations.go: will read migrations from disk."
|
|
|
|
else
|
|
|
|
echo "Compiling migrations into migrations.go"
|
|
|
|
fi
|
|
|
|
go-bindata -debug=$DEX_MIGRATE_FROM_DISK -modtime=1 -pkg migrations -o ./db/migrations/assets.go ./db/migrations
|
|
|
|
gofmt -w ./db/migrations/assets.go
|
|
|
|
else
|
|
|
|
echo "Could not find go-bindata in path, will not generate migrations"
|
2015-10-20 16:00:33 +05:30
|
|
|
echo "Install go-bindata with: go get -u github.com/jteeuwen/go-bindata/..."
|
2015-08-20 04:10:36 +05:30
|
|
|
fi
|
|
|
|
|
2015-08-18 05:57:27 +05:30
|
|
|
rm -rf $GOPATH/src/github.com/coreos/dex
|
|
|
|
mkdir -p $GOPATH/src/github.com/coreos/
|
2015-10-17 05:19:27 +05:30
|
|
|
|
|
|
|
# Only attempt to link dex into godeps if it isn't already there
|
2015-10-17 03:16:37 +05:30
|
|
|
[ -d $GOPATH/src/github.com/coreos/dex ] || ln -s ${PWD} $GOPATH/src/github.com/coreos/dex
|
2015-08-18 05:57:27 +05:30
|
|
|
|
2015-12-17 03:58:20 +05:30
|
|
|
LD_FLAGS="-X main.version=$(./git-version)"
|
2015-08-18 05:57:27 +05:30
|
|
|
go build -o bin/dex-worker -ldflags="$LD_FLAGS" github.com/coreos/dex/cmd/dex-worker
|
|
|
|
go build -o bin/dexctl github.com/coreos/dex/cmd/dexctl
|
|
|
|
go build -o bin/dex-overlord -ldflags="$LD_FLAGS" github.com/coreos/dex/cmd/dex-overlord
|
|
|
|
go build -o bin/example-app github.com/coreos/dex/examples/app
|
|
|
|
go build -o bin/example-cli github.com/coreos/dex/examples/cli
|