Skip to content

Commit

Permalink
Merge pull request #280 from blaggacao/fix-docker-to-host-writes
Browse files Browse the repository at this point in the history
Implement go generate support
  • Loading branch information
LandonTClipp authored Jun 3, 2020
2 parents a4307a1 + 7dec8ca commit 1ac9574
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM golang:1.14-alpine as builder

COPY ./ /mockery
RUN cd /mockery && go install ./...

FROM golang:1.14-alpine

COPY mockery /
COPY --from=builder /go/bin/mockery /

# Explicitly set a writable cache path when running --user=$(id -u):$(id -g)
# see: https://github.com/golang/go/issues/26280#issuecomment-445294378
ENV GOCACHE /tmp/.cache

ENTRYPOINT ["/mockery"]
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL=bash

all: clean fmt test fixture install integration
all: clean fmt test fixture install docker integration

clean:
rm -rf mocks
Expand All @@ -17,5 +17,8 @@ fixture:
install:
go install ./...

integration:
docker:
docker build -t vektra/mockery .

integration: docker install
./hack/run-e2e.sh
9 changes: 9 additions & 0 deletions hack/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ verify
reset
${GOPATH}/bin/mockery -all -recursive -cpuprofile="mockery.prof" -srcpkg github.com/vektra/mockery/mockery/fixtures
verify


reset
docker run -v $(pwd):/src -w /src --user=$(id -u):$(id -g) vektra/mockery -all -recursive -cpuprofile="mockery.prof" -dir="mockery/fixtures"
verify

reset
docker run -v $(pwd):/src -w /src --user=$(id -u):$(id -g) vektra/mockery -all -recursive -cpuprofile="mockery.prof" -srcpkg github.com/vektra/mockery/mockery/fixtures
verify

0 comments on commit 1ac9574

Please sign in to comment.