Add -mod=vendor in Makefile

This commit is contained in:
Frédéric Guillot 2018-12-28 13:58:01 -08:00
parent 79e7d007a4
commit 362fc5c2ff

View file

@ -5,6 +5,8 @@ LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app
PKG_LIST := $(shell go list ./... | grep -v /vendor/) PKG_LIST := $(shell go list ./... | grep -v /vendor/)
DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
export GO111MODULE=on
.PHONY: generate .PHONY: generate
.PHONY: miniflux .PHONY: miniflux
.PHONY: linux-amd64 .PHONY: linux-amd64
@ -19,7 +21,7 @@ DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
.PHONY: build run clean test lint integration-test clean-integration-test .PHONY: build run clean test lint integration-test clean-integration-test
generate: generate:
@ go generate @ go generate -mod=vendor
miniflux: generate miniflux: generate
@ go build -mod=vendor -ldflags=$(LD_FLAGS) -o $(APP) main.go @ go build -mod=vendor -ldflags=$(LD_FLAGS) -o $(APP) main.go
@ -54,13 +56,13 @@ windows-amd64: generate
build: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin-amd64 freebsd-amd64 openbsd-amd64 windows-amd64 build: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin-amd64 freebsd-amd64 openbsd-amd64 windows-amd64
run: generate run: generate
@ go run main.go -debug @ go run -mod=vendor main.go -debug
clean: clean:
@ rm -f $(APP)-* $(APP) @ rm -f $(APP)-* $(APP)
test: test:
go test -cover -race -count=1 ./... go test -mod=vendor -cover -race -count=1 ./...
lint: lint:
@ golint -set_exit_status ${PKG_LIST} @ golint -set_exit_status ${PKG_LIST}
@ -68,12 +70,12 @@ lint:
integration-test: integration-test:
psql -U postgres -c 'drop database if exists miniflux_test;' psql -U postgres -c 'drop database if exists miniflux_test;'
psql -U postgres -c 'create database miniflux_test;' psql -U postgres -c 'create database miniflux_test;'
DATABASE_URL=$(DB_URL) go run main.go -migrate DATABASE_URL=$(DB_URL) go run -mod=vendor main.go -migrate
DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run -mod=vendor main.go -create-admin
go build -o miniflux-test main.go go build -mod=vendor -o miniflux-test main.go
DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid" DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid"
while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null
go test -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log go test -mod=vendor -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log
clean-integration-test: clean-integration-test:
@ kill -9 `cat /tmp/miniflux.pid` @ kill -9 `cat /tmp/miniflux.pid`