dbmate/Makefile

27 lines
677 B
Makefile
Raw Normal View History

DC := docker-compose
2016-05-21 20:01:49 -07:00
BUILD_FLAGS := -ldflags '-s'
2018-01-07 20:12:56 -08:00
PACKAGES := ./cmd/... ./pkg/...
2015-11-25 10:57:58 -08:00
all: clean container test lint build
2015-12-01 18:35:18 -08:00
clean:
rm -rf dist
2015-11-25 10:57:58 -08:00
2015-12-01 17:36:23 -08:00
container:
$(DC) pull
$(DC) build
$(DC) up -d
2015-11-25 10:57:58 -08:00
lint:
$(DC) run --rm dbmate golint -set_exit_status $(PACKAGES)
$(DC) run --rm dbmate go vet $(PACKAGES)
$(DC) run --rm dbmate errcheck $(PACKAGES)
2015-11-25 10:57:58 -08:00
test:
$(DC) run --rm dbmate go test -v $(PACKAGES)
2015-12-01 17:36:23 -08:00
build: clean
$(DC) run --rm -e GOARCH=amd64 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64 ./cmd/dbmate
# musl target does not support sqlite
$(DC) run --rm -e GOARCH=amd64 -e CGO_ENABLED=0 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64 ./cmd/dbmate