dbmate/Makefile

35 lines
604 B
Makefile
Raw Normal View History

DC := docker-compose
2016-05-21 20:01:49 -07:00
BUILD_FLAGS := -ldflags '-s'
2015-11-25 10:57:58 -08:00
.PHONY: all
all: test lint build
2015-11-25 10:57:58 -08:00
.PHONY: test
test:
go test -v ./...
2015-11-25 10:57:58 -08:00
.PHONY: lint
2015-11-25 10:57:58 -08:00
lint:
golangci-lint run
2015-11-25 10:57:58 -08:00
.PHONY: wait
wait:
dist/dbmate-linux-amd64 -e MYSQL_URL wait
dist/dbmate-linux-amd64 -e POSTGRESQL_URL wait
.PHONY: clean
clean:
rm -rf dist
2015-12-01 17:36:23 -08:00
.PHONY: build
build: clean
GOARCH=amd64 go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64 .
# musl target does not support sqlite
GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64 .
.PHONY: docker
docker:
$(DC) pull
$(DC) build
$(DC) run --rm dbmate make