aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-12-28 13:58:01 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-12-28 17:21:57 -0800
commit362fc5c2ff15cb73b3c8e053c6c97b3d2110f207 (patch)
tree954fb6b15f9a1141ce483b121b24d018289a98a7 /Makefile
parent79e7d007a46c1f6fa4b5799d470766ff859804d2 (diff)
Add -mod=vendor in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 24a0c50..ad007a9 100644
--- a/Makefile
+++ b/Makefile
@@ -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/)
DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
+export GO111MODULE=on
+
.PHONY: generate
.PHONY: miniflux
.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
generate:
- @ go generate
+ @ go generate -mod=vendor
miniflux: generate
@ 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
run: generate
- @ go run main.go -debug
+ @ go run -mod=vendor main.go -debug
clean:
@ rm -f $(APP)-* $(APP)
test:
- go test -cover -race -count=1 ./...
+ go test -mod=vendor -cover -race -count=1 ./...
lint:
@ golint -set_exit_status ${PKG_LIST}
@@ -68,12 +70,12 @@ lint:
integration-test:
psql -U postgres -c 'drop database if exists miniflux_test;'
psql -U postgres -c 'create database miniflux_test;'
- DATABASE_URL=$(DB_URL) go run main.go -migrate
- DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin
- go build -o miniflux-test main.go
+ DATABASE_URL=$(DB_URL) go run -mod=vendor main.go -migrate
+ DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run -mod=vendor main.go -create-admin
+ 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"
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:
@ kill -9 `cat /tmp/miniflux.pid`