2016-10-23 21:56:37 +00:00
|
|
|
TESTFLAGS?=
|
2015-10-15 16:49:43 +00:00
|
|
|
IMAGE=mattes/migrate
|
|
|
|
DCR=docker-compose run --rm
|
2016-10-23 21:56:37 +00:00
|
|
|
GOTEST=go test $(TESTFLAGS) `go list ./... | grep -v "/vendor/"`
|
2015-10-15 16:49:43 +00:00
|
|
|
|
2016-10-23 21:56:37 +00:00
|
|
|
.PHONY: clean test build release docker-build docker-push run
|
2015-10-15 16:49:43 +00:00
|
|
|
all: release
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f migrate
|
|
|
|
|
2016-10-23 21:56:37 +00:00
|
|
|
fmt:
|
|
|
|
@gofmt -s -w `go list -f {{.Dir}} ./... | grep -v "/vendor/"`
|
|
|
|
|
|
|
|
test: fmt
|
|
|
|
$(DCR) $(GOTEST)
|
|
|
|
|
|
|
|
go-test: fmt
|
|
|
|
@$(GOTEST)
|
2015-10-15 16:49:43 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
$(DCR) go-build
|
|
|
|
|
|
|
|
release: test build docker-build docker-push
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
docker build --rm -t $(IMAGE) .
|
|
|
|
|
|
|
|
docker-push:
|
|
|
|
docker push $(IMAGE)
|