forked from mystiq/dex
Merge pull request #233 from ericchiang/generate
don't call go-bindata on every build
This commit is contained in:
commit
b40de37e4e
3 changed files with 39 additions and 26 deletions
16
build
16
build
|
@ -3,22 +3,6 @@
|
|||
export GOPATH=${PWD}/Godeps/_workspace
|
||||
export GOBIN=${PWD}/bin
|
||||
|
||||
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"
|
||||
echo "Install go-bindata with: go get -u github.com/jteeuwen/go-bindata/..."
|
||||
fi
|
||||
|
||||
rm -rf $GOPATH/src/github.com/coreos/dex
|
||||
mkdir -p $GOPATH/src/github.com/coreos/
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
6
db/migrations/migrations.go
Normal file
6
db/migrations/migrations.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package migrations
|
||||
|
||||
// To download go-bindata run `go get -u github.com/jteeuwen/go-bindata/...`
|
||||
|
||||
//go:generate go-bindata -modtime=1 -pkg migrations -o assets.go ../
|
||||
//go:generate gofmt -w assets.go
|
Loading…
Reference in a new issue