Skip to content

Commit 57f0d3b

Browse files
committed
deploy: custom image
1 parent 736cd57 commit 57f0d3b

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# go lint tool dependencies `go list` `gofmt`
2+
FROM golang:1.20.14-alpine3.19
3+
4+
# if you want to install other tools, please add them here.
5+
# Do not install unnecessary tools to reduce image size.
6+
RUN set -eux \
7+
apk update && \
8+
apk --no-cache add ca-certificates git openssh yarn libpcap-dev curl bash build-base
9+
10+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.61.0
11+
12+
WORKDIR /
13+
14+
# SSH config
15+
RUN mkdir -p /root/.ssh && chown -R root /root/.ssh/ && chgrp -R root /root/.ssh/ \
16+
&& git config --global url."git@github.com:".insteadOf https://github.com/ \
17+
&& git config --global url."git://".insteadOf https://
18+
COPY deploy/config /root/.ssh/config
19+
COPY deploy/github-known-hosts /github_known_hosts
20+
21+
# set go proxy and private repo
22+
RUN go env -w GOPROXY=https://goproxy.cn,direct \
23+
&& go env -w GOPRIVATE=github.com/qbox,qiniu.com
24+
25+
EXPOSE 8888

config/.image/golangci-lint.1.59.1.Dockerfile renamed to config/.image/go1.22.3.gocilint.1.59.1.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ FROM golang:1.22.3-alpine3.20
55
# Do not install unnecessary tools to reduce image size.
66
RUN set -eux \
77
apk update && \
8-
apk --no-cache add ca-certificates git openssh yarn libpcap-dev curl openjdk11 bash build-base && \
9-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.59.1
8+
apk --no-cache add ca-certificates git openssh yarn libpcap-dev curl openjdk11 bash build-base
9+
10+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.59.1
1011

1112
WORKDIR /
1213

config/.image/golangci-lint.1.61.0.Dockerfile renamed to config/.image/go1.23.2.gocilint.1.61.0.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ FROM golang:1.23.2-alpine3.20
55
# Do not install unnecessary tools to reduce image size.
66
RUN set -eux \
77
apk update && \
8-
apk --no-cache add ca-certificates git openssh yarn libpcap-dev curl openjdk11 bash build-base && \
9-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.61.0
8+
apk --no-cache add ca-certificates git openssh yarn libpcap-dev curl openjdk11 bash build-base
9+
10+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.61.0
1011

1112
WORKDIR /
1213

config/config.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ customConfig: # custom config for specific orgs or repos
4747
enable: true
4848
dockerAsRunner:
4949
# kodo only use go1.22.+, see kodo/logservice/logupload/version/check_test.go
50-
image: "aslan-spock-register.qiniu.io/reviewbot/base:golangci-lint.1.59.1"
50+
image: "aslan-spock-register.qiniu.io/reviewbot/base:go1.22.3-gocilint.1.59.1"
5151
command:
5252
- "/bin/sh"
5353
- "-c"
@@ -110,14 +110,14 @@ customConfig: # custom config for specific orgs or repos
110110
go mod tidy
111111
CGO_ENABLED=1 golangci-lint run --timeout=10m0s --allow-parallel-runners=true --print-issued-lines=false --out-format=line-number >> $ARTIFACT/lint.log 2>&1
112112
dockerAsRunner:
113-
image: "aslan-spock-register.qiniu.io/reviewbot/base:golangci-lint.1.59.1"
113+
image: "aslan-spock-register.qiniu.io/reviewbot/base:go1.22.3-gocilint.1.59.1"
114114

115115
qiniu/reviewbot:
116116
linters:
117117
golangci-lint:
118118
enable: true
119119
kubernetesAsRunner:
120-
image: "aslan-spock-register.qiniu.io/reviewbot/base:golangci-lint.1.61.0"
120+
image: "aslan-spock-register.qiniu.io/reviewbot/base:go1.23.2-gocilint.1.61.0"
121121
namespace: "reviewbot"
122122

123123
qbox/ffmpeg:
@@ -126,6 +126,12 @@ customConfig: # custom config for specific orgs or repos
126126
repo: ffmpeg
127127
pathAlias: "src/qbox.com/ffmpeg"
128128

129+
qbox/net-schedule:
130+
linters:
131+
golangci-lint:
132+
dockerAsRunner:
133+
image: "aslan-spock-register.qiniu.io/reviewbot/base:go1.20.14-gocilint.1.61.0"
134+
129135
issueReferences:
130136
golangci-lint:
131137
- pattern: '^ST1003: .+ \(stylecheck\)$'

internal/linters/providergithub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (g *GithubProvider) CreateGithubChecks(ctx context.Context, a Agent, lintEr
462462
checkRun, resp, err := g.GithubClient.Checks.CreateCheckRun(ctx, owner, repo, check)
463463
if err != nil {
464464
if !errors.Is(err, context.Canceled) {
465-
log.Errorf("create check run failed: %v", err)
465+
log.Errorf("create check run failed: %v, check: %v", err, check)
466466
}
467467
return err
468468
}

0 commit comments

Comments
 (0)