Skip to content

Commit

Permalink
use vendor directory when building - fixes fabiolb#638
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronhurt committed Apr 12, 2019
1 parent 3d02439 commit 9b63ac5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ RUN cd /usr/local/bin && unzip vault_${vault_version}_linux_amd64.zip

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

FROM alpine:3.8
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ help:

# build compiles fabio and the test dependencies
build: gofmt
go build
go build -mod=vendor

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

# gofmt runs gofmt on the code
gofmt:
Expand All @@ -56,7 +56,7 @@ linux:

# install runs go install
install:
go install $(GOFLAGS)
go install -mod=vendor $(GOFLAGS)

# pkg builds a fabio.tar.gz package with only fabio in it
pkg: build test
Expand Down Expand Up @@ -119,7 +119,7 @@ codeship:

# clean removes intermediate files
clean:
go clean
go clean -mod=vendor
rm -rf pkg dist fabio
find . -name '*.test' -delete

Expand Down

0 comments on commit 9b63ac5

Please sign in to comment.