Install golangci-lint and goswag in separate layers with go modules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Anton Zadvorny 2019-09-01 19:13:43 +03:00
parent adeff1e4ee
commit fc824c1324

View File

@ -6,6 +6,7 @@ ENV TERM=xterm-color
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GO111MODULE=on
ENV GOLANGCI=1.17.1
ENV GOSWAG=1.6.2
@ -19,19 +20,14 @@ RUN \
echo "${TZ}" > /etc/timezone && date
RUN \
# golangci install
go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint && \
cd /go/src/github.com/golangci/golangci-lint && \
git checkout v${GOLANGCI} && \
cd /go/src/github.com/golangci/golangci-lint/cmd/golangci-lint && \
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" && \
# goswag install
go get -u -v github.com/swaggo/swag/cmd/swag && \
cd /go/src/github.com/swaggo/swag && \
git checkout v${GOSWAG} && \
cd /go/src/github.com/swaggo/swag/cmd/swag && \
go install && \
# show versions
go version && \
golangci-lint --version && \
go version
RUN \
go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI} && \
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" github.com/golangci/golangci-lint/cmd/golangci-lint && \
golangci-lint --version
RUN \
go get -u -v github.com/swaggo/swag/cmd/swag@v${GOSWAG} && \
go install github.com/swaggo/swag/cmd/swag && \
swag --version