2015-03-16 23:59:46 -05:00
|
|
|
DOCKER_RELEASE_TAG = "sosedoff/pgweb:$(shell git describe --abbrev=0 --tags | sed 's/v//')"
|
2014-11-26 12:48:41 +00:00
|
|
|
BINDATA_IGNORE = $(shell git ls-files -io --exclude-standard $< | sed 's/^/-ignore=/;s/[.]/[.]/g')
|
2014-10-31 05:02:58 +00:00
|
|
|
|
2014-12-26 20:50:15 -06:00
|
|
|
usage:
|
|
|
|
@echo ""
|
|
|
|
@echo "Task : Description"
|
|
|
|
@echo "----------------- : -------------------"
|
|
|
|
@echo "make setup : Install all necessary dependencies"
|
|
|
|
@echo "make dev : Generate development build"
|
2014-12-26 20:51:04 -06:00
|
|
|
@echo "make test : Run tests"
|
2014-12-26 20:50:15 -06:00
|
|
|
@echo "make build : Generate production build for current OS"
|
2015-02-02 14:15:57 -06:00
|
|
|
@echo "make bootstrap : Install cross-compilation toolchain"
|
2014-12-26 20:50:15 -06:00
|
|
|
@echo "make release : Generate binaries for all supported OSes"
|
|
|
|
@echo "make clean : Remove all build files and reset assets"
|
|
|
|
@echo "make assets : Generate production assets file"
|
|
|
|
@echo "make dev-assets : Generate development assets file"
|
2014-12-31 18:47:21 -06:00
|
|
|
@echo "make docker : Build docker image"
|
2015-03-17 00:01:28 -05:00
|
|
|
@echo "make docker-release : Build and tag docker image"
|
2014-12-26 20:50:15 -06:00
|
|
|
@echo ""
|
|
|
|
|
2014-12-17 21:39:03 -06:00
|
|
|
test:
|
2015-04-30 11:53:21 -05:00
|
|
|
godep go test -cover ./...
|
2014-12-17 21:39:03 -06:00
|
|
|
|
2014-11-26 12:48:41 +00:00
|
|
|
assets: static/
|
2015-04-30 11:47:07 -05:00
|
|
|
go-bindata -o pkg/data/bindata.go -pkg data $(BINDATA_OPTS) $(BINDATA_IGNORE) -ignore=[.]gitignore -ignore=[.]gitkeep $<...
|
2014-10-31 05:02:58 +00:00
|
|
|
|
2014-11-11 18:13:23 -06:00
|
|
|
dev-assets:
|
2014-11-26 12:41:25 +00:00
|
|
|
@$(MAKE) --no-print-directory assets BINDATA_OPTS="-debug"
|
2014-10-31 05:02:58 +00:00
|
|
|
|
2014-12-13 20:43:07 -06:00
|
|
|
dev: dev-assets
|
|
|
|
godep go build
|
|
|
|
@echo "You can now execute ./pgweb"
|
|
|
|
|
2014-11-11 18:13:23 -06:00
|
|
|
build: assets
|
2014-12-13 20:43:07 -06:00
|
|
|
godep go build
|
|
|
|
@echo "You can now execute ./pgweb"
|
|
|
|
|
|
|
|
release: assets
|
2014-10-27 15:26:14 -05:00
|
|
|
gox -osarch="darwin/amd64 darwin/386 linux/amd64 linux/386 windows/amd64 windows/386" -output="./bin/pgweb_{{.OS}}_{{.Arch}}"
|
2014-10-25 12:55:12 -05:00
|
|
|
|
2015-02-02 14:15:57 -06:00
|
|
|
bootstrap:
|
|
|
|
gox -build-toolchain
|
|
|
|
|
2014-10-24 20:52:15 -05:00
|
|
|
setup:
|
2014-11-05 18:18:41 -06:00
|
|
|
go get github.com/tools/godep
|
2015-03-04 08:53:16 -06:00
|
|
|
go get golang.org/x/tools/cmd/cover
|
2014-11-05 22:04:47 -06:00
|
|
|
godep get github.com/mitchellh/gox
|
|
|
|
godep get github.com/jteeuwen/go-bindata/...
|
|
|
|
godep restore
|
2014-10-10 17:32:47 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f ./pgweb
|
2014-10-13 18:31:28 -05:00
|
|
|
rm -f ./bin/*
|
2014-10-31 05:02:58 +00:00
|
|
|
rm -f bindata.go
|
2014-12-28 00:05:25 -06:00
|
|
|
make assets
|
2014-11-05 18:27:14 -06:00
|
|
|
|
|
|
|
docker:
|
2015-03-16 23:59:46 -05:00
|
|
|
docker build -t pgweb .
|
|
|
|
|
|
|
|
docker-release:
|
|
|
|
docker build -t $(DOCKER_RELEASE_TAG) .
|