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 CGO_ENABLED=0
ENV GOOS=linux ENV GOOS=linux
ENV GOARCH=amd64 ENV GOARCH=amd64
ENV GO111MODULE=on
ENV GOLANGCI=1.17.1 ENV GOLANGCI=1.17.1
ENV GOSWAG=1.6.2 ENV GOSWAG=1.6.2
@ -19,19 +20,14 @@ RUN \
echo "${TZ}" > /etc/timezone && date echo "${TZ}" > /etc/timezone && date
RUN \ RUN \
# golangci install go version
go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint && \
cd /go/src/github.com/golangci/golangci-lint && \ RUN \
git checkout v${GOLANGCI} && \ go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint@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)'" 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)'" && \ golangci-lint --version
# goswag install
go get -u -v github.com/swaggo/swag/cmd/swag && \ RUN \
cd /go/src/github.com/swaggo/swag && \ go get -u -v github.com/swaggo/swag/cmd/swag@v${GOSWAG} && \
git checkout v${GOSWAG} && \ go install github.com/swaggo/swag/cmd/swag && \
cd /go/src/github.com/swaggo/swag/cmd/swag && \
go install && \
# show versions
go version && \
golangci-lint --version && \
swag --version swag --version