Commit f5c2b771 by Arve Knudsen Committed by GitHub

Chore: Upgrade golangci-lint (#27719)

* Chore: Upgrade golangci-lint to latest
* ci-build: Upgrade Node/Yarn

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent ed054c20
...@@ -311,6 +311,6 @@ ...@@ -311,6 +311,6 @@
"node": ">=12 <13" "node": ">=12 <13"
}, },
"volta": { "volta": {
"node": "12.18.3" "node": "12.18.4"
} }
} }
...@@ -14,8 +14,8 @@ The home directory will be `/home/circleci` ...@@ -14,8 +14,8 @@ The home directory will be `/home/circleci`
- npm is installed globally - npm is installed globally
## Go ## Go
- Go 1.14 is installed in `/usr/local/bin/go` - Go is installed in `/usr/local/bin/go`
- golangci-lint 1.23.7 is installed in `/usr/local/bin/golangci-lint` - golangci-lint is installed in `/usr/local/bin/golangci-lint`
- mage is installed in `/home/circleci/go/bin/mage` - mage is installed in `/home/circleci/go/bin/mage`
All of the above directories are in the path, so there is no need to specify fully qualified paths. All of the above directories are in the path, so there is no need to specify fully qualified paths.
...@@ -58,4 +58,4 @@ cd test ...@@ -58,4 +58,4 @@ cd test
``` ```
You will be in /home/circleci/test with the buildscripts installed to the local directory. You will be in /home/circleci/test with the buildscripts installed to the local directory.
Do your edits/run tests. When saving, your edits will be available in the container immediately. Do your edits/run tests. When saving, your edits will be available in the container immediately.
\ No newline at end of file
...@@ -14,8 +14,8 @@ The home directory will be `/home/circleci` ...@@ -14,8 +14,8 @@ The home directory will be `/home/circleci`
- npm is installed globally - npm is installed globally
## Go ## Go
- Go 1.14 is installed in `/usr/local/bin/go` - Go is installed in `/usr/local/bin/go`
- golangci-lint 1.23.7 is installed in `/usr/local/bin/golangci-lint` - golangci-lint is installed in `/usr/local/bin/golangci-lint`
- mage is installed in `/home/circleci/go/bin/mage` - mage is installed in `/home/circleci/go/bin/mage`
All of the above directories are in the path, so there is no need to specify fully qualified paths. All of the above directories are in the path, so there is no need to specify fully qualified paths.
...@@ -58,4 +58,4 @@ cd test ...@@ -58,4 +58,4 @@ cd test
``` ```
You will be in /home/circleci/test with the buildscripts installed to the local directory. You will be in /home/circleci/test with the buildscripts installed to the local directory.
Do your edits/run tests. When saving, your edits will be available in the container immediately. Do your edits/run tests. When saving, your edits will be available in the container immediately.
\ No newline at end of file
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's. # Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
FROM debian:stretch-20200803-slim AS toolchain FROM debian:stretch-20200908-slim AS toolchain
ARG OSX_SDK_URL
ENV OSX_MIN=10.10 \ ENV OSX_MIN=10.10 \
CTNG=1.24.0 \ CTNG=1.24.0 \
...@@ -49,7 +47,7 @@ RUN apt-get update && \ ...@@ -49,7 +47,7 @@ RUN apt-get update && \
lzma-dev lzma-dev
RUN git clone https://github.com/tpoechtrager/osxcross.git /tmp/osxcross && \ RUN git clone https://github.com/tpoechtrager/osxcross.git /tmp/osxcross && \
cd /tmp/osxcross && git reset --hard $OSX_CROSS_REV cd /tmp/osxcross && git reset --hard $OSX_CROSS_REV
RUN curl -fL "${OSX_SDK_URL}" -o /tmp/osxcross/tarballs/$(echo "${OSX_SDK_URL}" | grep -E 'MacOSX[^?]+' -o) COPY MacOSX10.15.sdk.tar.xz /tmp/osxcross/tarballs/
RUN ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil RUN ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil
RUN UNATTENDED=1 OSX_VERSION_MIN=${OSX_MIN} /tmp/osxcross/build.sh RUN UNATTENDED=1 OSX_VERSION_MIN=${OSX_MIN} /tmp/osxcross/build.sh
RUN rm -rf /tmp/osxcross/target/SDK/*/usr/share && \ RUN rm -rf /tmp/osxcross/target/SDK/*/usr/share && \
...@@ -75,8 +73,8 @@ RUN cd /tmp && \ ...@@ -75,8 +73,8 @@ RUN cd /tmp && \
rm -rf /tmp/x86_64-centos6-linux-gnu/ && \ rm -rf /tmp/x86_64-centos6-linux-gnu/ && \
rm -rf /tmp/crosstool-ng-${CTNG} rm -rf /tmp/crosstool-ng-${CTNG}
ARG GOLANGCILINT_VERSION=1.30.0 ARG GOLANGCILINT_VERSION=1.31.0
ARG GOLANGCILINT_CHKSUM=c8e8fc5753e74d2eb489ad428dbce219eb9907799a57c02bcd8b80b4b98c60d4 ARG GOLANGCILINT_CHKSUM=9a5d47b51442d68b718af4c7350f4406cdc087e2236a5b9ae52f37aebede6cb3
RUN curl -fLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz RUN curl -fLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz
RUN echo ${GOLANGCILINT_CHKSUM} golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz | sha256sum --check --strict --status RUN echo ${GOLANGCILINT_CHKSUM} golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz | sha256sum --check --strict --status
...@@ -85,13 +83,13 @@ RUN mv golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64/golangci-lint /tmp/ ...@@ -85,13 +83,13 @@ RUN mv golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64/golangci-lint /tmp/
# Base image to crossbuild grafana. # Base image to crossbuild grafana.
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's. # Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
FROM debian:stretch-20200803 FROM debian:stretch-20200908
ENV GOVERSION=1.15.1 \ ENV GOVERSION=1.15.1 \
PATH=/usr/local/go/bin:$PATH \ PATH=/usr/local/go/bin:$PATH \
GOPATH=/go \ GOPATH=/go \
NODEVERSION=12.18.3-1nodesource1 \ NODEVERSION=12.18.4-1nodesource1 \
YARNVERSION=1.22.4-1 \ YARNVERSION=1.22.5-1 \
GO111MODULE=on GO111MODULE=on
# Use ARG so as not to persist environment variable in image # Use ARG so as not to persist environment variable in image
......
...@@ -23,6 +23,6 @@ The image is based on Debian Stretch, since we want an older Linux distribution ...@@ -23,6 +23,6 @@ The image is based on Debian Stretch, since we want an older Linux distribution
In order to build and publish the Grafana build Docker image, execute the following: In order to build and publish the Grafana build Docker image, execute the following:
``` ```
export OSX_SDK_URL=<f.ex. signed GCS URL to download OSX SDK> # Download MacOSX10.15.sdk.tar.xz from our private GCS bucket into this directory
./build-deploy.sh ./build-deploy.sh
``` ```
#!/bin/bash #!/bin/bash
set -eo pipefail set -eo pipefail
_version="1.2.26" _version="1.2.27"
_tag="grafana/build-container:${_version}" _tag="grafana/build-container:${_version}"
_dpath=$(dirname "${BASH_SOURCE[0]}") _dpath=$(dirname "${BASH_SOURCE[0]}")
cd "$_dpath" cd "$_dpath"
if [[ -z "${OSX_SDK_URL}" ]]; then docker build -t $_tag .
echo You must set OSX_SDK_URL
exit 1
fi
docker build --build-arg OSX_SDK_URL="${OSX_SDK_URL}" -t $_tag .
docker push $_tag docker push $_tag
...@@ -3,7 +3,7 @@ module github.com/grafana/grafana/scripts/go ...@@ -3,7 +3,7 @@ module github.com/grafana/grafana/scripts/go
go 1.14 go 1.14
require ( require (
github.com/golangci/golangci-lint v1.30.0 github.com/golangci/golangci-lint v1.31.0
github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mgechev/revive v1.0.2 github.com/mgechev/revive v1.0.2
github.com/unknwon/bra v0.0.0-20190805204333-bb0929b6cca0 github.com/unknwon/bra v0.0.0-20190805204333-bb0929b6cca0
...@@ -11,6 +11,5 @@ require ( ...@@ -11,6 +11,5 @@ require (
github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect
github.com/urfave/cli v1.20.0 // indirect github.com/urfave/cli v1.20.0 // indirect
golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9 // indirect golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9 // indirect
golang.org/x/tools v0.0.0-20200809012840-6f4f008689da // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment