-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
go: gotest/tools@dev:0.0.8 | ||
go: gotest/tools@0.0.8 | ||
|
||
workflows: | ||
version: 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,20 @@ | ||
|
||
ARG GOLANG_VERSION | ||
FROM golang:${GOLANG_VERSION:-1.11-alpine} as golang | ||
FROM golang:${GOLANG_VERSION:-1.12-alpine} as golang | ||
RUN apk add -U curl git bash | ||
ENV CGO_ENABLED=0 \ | ||
PS1="# " \ | ||
GO111MODULE=on | ||
WORKDIR /go/src/gotest.tools/gotestsum | ||
ENV CGO_ENABLED=0 | ||
ENV PS1="# " | ||
|
||
|
||
FROM golang as tools | ||
ARG FILEWATCHER=v0.3.2 | ||
RUN go get -d github.com/dnephin/filewatcher && \ | ||
cd /go/src/github.com/dnephin/filewatcher && \ | ||
git checkout -q "$FILEWATCHER" && \ | ||
go build -o /usr/bin/filewatcher . | ||
ARG DEP_TAG=v0.4.1 | ||
RUN go get -d github.com/golang/dep/cmd/dep && \ | ||
cd /go/src/github.com/golang/dep && \ | ||
git checkout -q "$DEP_TAG" && \ | ||
go build -o /usr/bin/dep ./cmd/dep | ||
|
||
RUN go get github.com/dnephin/filewatcher@v0.3.2 | ||
RUN wget -O- -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s && \ | ||
mv bin/golangci-lint /go/bin | ||
|
||
FROM golang as dev | ||
COPY --from=tools /usr/bin/filewatcher /usr/bin/filewatcher | ||
COPY --from=tools /usr/bin/dep /usr/bin/dep | ||
|
||
COPY --from=tools /go/bin/filewatcher /usr/bin/filewatcher | ||
COPY --from=tools /go/bin/golangci-lint /usr/bin/golangci-lint | ||
|
||
FROM dev as dev-with-source | ||
COPY . . | ||
|
||
|
||
FROM golang as linter | ||
ARG GOMETALINTER=v2.0.5 | ||
RUN go get -d github.com/alecthomas/gometalinter && \ | ||
cd /go/src/github.com/alecthomas/gometalinter && \ | ||
git checkout -q "$GOMETALINTER" && \ | ||
go build -v -o /usr/local/bin/gometalinter . && \ | ||
gometalinter --install && \ | ||
rm -rf /go/src/* /go/pkg/* | ||
ENTRYPOINT ["/usr/local/bin/gometalinter"] | ||
CMD ["--config=.gometalinter.json", "./..."] | ||
|
||
|
||
FROM linter as linter-with-source | ||
COPY . . |