Separate cmd package for easier importing (#11)

This commit is contained in:
Adrian Macneil 2017-05-04 20:58:23 -07:00 committed by GitHub
parent 247d7296f8
commit e393f387b3
21 changed files with 408 additions and 368 deletions

View file

@ -1,7 +1,8 @@
DC := docker-compose
BUILD_FLAGS := -ldflags '-s'
PACKAGES := . ./cmd/dbmate
all: clean container lint test build
all: clean container test lint build
clean:
rm -rf dist
@ -12,15 +13,15 @@ container:
$(DC) up -d
lint:
$(DC) run dbmate golint
$(DC) run dbmate go vet
$(DC) run dbmate errcheck
$(DC) run dbmate golint -set_exit_status $(PACKAGES)
$(DC) run dbmate go vet $(PACKAGES)
$(DC) run dbmate errcheck $(PACKAGES)
test:
$(DC) run dbmate go test -v
$(DC) run dbmate go test -v $(PACKAGES)
build: clean
$(DC) run -e GOARCH=386 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-i386
$(DC) run -e GOARCH=amd64 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64
$(DC) run -e GOARCH=386 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-i386 ./cmd/dbmate
$(DC) run -e GOARCH=amd64 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-amd64 ./cmd/dbmate
# musl target does not support sqlite
$(DC) run -e GOARCH=amd64 -e CGO_ENABLED=0 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64
$(DC) run -e GOARCH=amd64 -e CGO_ENABLED=0 dbmate go build $(BUILD_FLAGS) -o dist/dbmate-linux-musl-amd64 ./cmd/dbmate