Skip to content
Permalink
Browse files

Add gofmt and go test to Dockerfile

@LucasRoesler mentioned these were not being run in the Makefile,
so I've added it to the Dockerfile. The Makefile is still fair
game for someone to update.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information...
alexellis committed Oct 21, 2019
1 parent 35356c8 commit c8d386ee4c8cd1953475bc1e0386be08aa1d5b76
Showing with 3 additions and 0 deletions.
  1. +3 −0 Dockerfile
@@ -12,6 +12,9 @@ ARG GIT_COMMIT
ARG VERSION
ARG OPTS

RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; } \
&& CGO_ENABLED=0 go test $(go list ./... | grep -v /vendor/) -cover

# add user in this stage because it cannot be done in next stage which is built from scratch
# in next stage we'll copy user and group information from this stage
RUN env ${OPTS} CGO_ENABLED=0 go build -ldflags "-s -w -X main.GitCommit=${GIT_COMMIT} -X main.Version=${VERSION}" -a -installsuffix cgo -o /usr/bin/inlets \

0 comments on commit c8d386e

Please sign in to comment.
You can’t perform that action at this time.