Skip to content

Commit fae4efa

Browse files
authored
use vendor directory when building - fixes #638
1 parent 3d02439 commit fae4efa

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RUN cd /usr/local/bin && unzip vault_${vault_version}_linux_amd64.zip
1010

1111
WORKDIR /go/src/github.com/fabiolb/fabio
1212
COPY . .
13-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -ldflags "-s -w" ./...
14-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w"
13+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -mod=vendor -ldflags "-s -w" ./...
14+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "-s -w"
1515

1616
FROM alpine:3.8
1717
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ help:
4040

4141
# build compiles fabio and the test dependencies
4242
build: gofmt
43-
go build
43+
go build -mod=vendor
4444

4545
# test runs the tests
4646
test: build
47-
go test -v -test.timeout 15s `go list ./... | grep -v '/vendor/'`
47+
go test -mod=vendor -v -test.timeout 15s /...
4848

4949
# gofmt runs gofmt on the code
5050
gofmt:
@@ -56,7 +56,7 @@ linux:
5656

5757
# install runs go install
5858
install:
59-
go install $(GOFLAGS)
59+
go install -mod=vendor $(GOFLAGS)
6060

6161
# pkg builds a fabio.tar.gz package with only fabio in it
6262
pkg: build test
@@ -119,7 +119,7 @@ codeship:
119119

120120
# clean removes intermediate files
121121
clean:
122-
go clean
122+
go clean -mod=vendor
123123
rm -rf pkg dist fabio
124124
find . -name '*.test' -delete
125125

0 commit comments

Comments
 (0)