File tree 8 files changed +40
-52
lines changed 8 files changed +40
-52
lines changed Original file line number Diff line number Diff line change 1
- FROM alpine:edge
1
+ ARG BASE=1.13.1-alpine3.10
2
+ FROM golang:${BASE} as build
2
3
4
+ WORKDIR /usr/src/app
5
+
6
+ COPY engine.json ./engine.json.template
7
+ RUN apk add --no-cache jq
8
+ RUN export go_version=$(go version | cut -d ' ' -f 3) && \
9
+ cat engine.json.template | jq '.version = .version + "/" + env.go_version' > ./engine.json
10
+
11
+ COPY codeclimate-golint.go go.mod go.sum ./
12
+ RUN apk add --no-cache git
13
+ RUN go build -o codeclimate-golint .
14
+
15
+ FROM golang:${BASE}
3
16
LABEL maintainer="Code Climate <hello@codeclimate.com>"
4
17
5
18
RUN adduser -u 9000 -D app
6
19
7
20
WORKDIR /usr/src/app
8
21
9
- COPY engine.json /engine.json
10
- COPY codeclimate-golint.go /usr/src/app/codeclimate-golint.go
11
-
12
- RUN apk add --no-cache --virtual .dev-deps musl-dev go git && \
13
- export GOPATH=/tmp/go GOBIN=/usr/local/bin && \
14
- go get -d -t -v . && \
15
- export LIBRARY_PATH=/usr/lib32:$LIBRARY_PATH && \
16
- go install codeclimate-golint.go && \
17
- apk del .dev-deps && \
18
- rm -rf "$GOPATH"
22
+ COPY --from=build /usr/src/app/engine.json /
23
+ COPY --from=build /usr/src/app/codeclimate-golint ./
19
24
20
25
USER app
21
- WORKDIR /code
22
26
VOLUME /code
23
27
24
- CMD ["/usr/local/bin /codeclimate-golint" ]
28
+ CMD ["/usr/src/app /codeclimate-golint" ]
Original file line number Diff line number Diff line change 2
2
3
3
IMAGE_NAME ?= codeclimate/codeclimate-golint
4
4
5
- update :
6
- docker run \
7
- --rm --interactive \
8
- -v $(PWD ) /engine.json:/engine.json \
9
- -v $(PWD ) /bin/update:/usr/local/bin/update \
10
- alpine:edge \
11
- /usr/local/bin/update
12
-
13
- image : update
5
+ image :
14
6
docker build --rm -t $(IMAGE_NAME ) .
Original file line number Diff line number Diff line change @@ -37,18 +37,6 @@ plugins:
37
37
make image
38
38
` ` `
39
39
40
- # ## Updating
41
-
42
- ` golint` doesn't version releases, so in order to get the latest version & force
43
- a new docker image build, we have to update the `engine.json` file.
44
-
45
- ` ` ` console
46
- make update
47
- ` ` `
48
-
49
- This will update the engine version with the latest `golint` version. After that
50
- rebuild the image as usually.
51
-
52
40
# ## Need help?
53
41
54
42
For help with Golint, [check out their documentation](https://github.com/golang/lint).
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,12 +2,13 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
- "github.com/codeclimate/cc-engine-go/engine"
6
- "github.com/golang/lint"
7
5
"io/ioutil"
8
6
"os"
9
7
"strconv"
10
8
"strings"
9
+
10
+ "github.com/codeclimate/cc-engine-go/engine"
11
+ "golang.org/x/lint"
11
12
)
12
13
13
14
const defaultMinConfidence = 0.8
Original file line number Diff line number Diff line change 8
8
"languages" : [
9
9
" Go"
10
10
],
11
- "version" : " 1.0.0/6aaf7c34af0f4c36a57e0c429bace4d706d8e931 " ,
11
+ "version" : " 1.0.0" ,
12
12
"spec_version" : " 0.3.1"
13
13
}
Original file line number Diff line number Diff line change
1
+ module github.com/codeclimate-community/codeclimate-golint
2
+
3
+ go 1.13
4
+
5
+ require (
6
+ github.com/codeclimate/cc-engine-go v0.0.0-20160217183426-55f9c825e2a9
7
+ golang.org/x/lint v0.0.0-20190930215403-16217165b5de
8
+ )
Original file line number Diff line number Diff line change
1
+ github.com/codeclimate/cc-engine-go v0.0.0-20160217183426-55f9c825e2a9 h1:Wk8UDfEjmZtZI8guLovZZ1QXkbGIPWy2cpeYS2JgKPg =
2
+ github.com/codeclimate/cc-engine-go v0.0.0-20160217183426-55f9c825e2a9 /go.mod h1:A0vs4JxevyA0WJrMjU/5sedZBlICgsdPloAKENM2JmU =
3
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 /go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w =
4
+ golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs =
5
+ golang.org/x/lint v0.0.0-20190930215403-16217165b5de /go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc =
6
+ golang.org/x/net v0.0.0-20190311183353-d8887717615a /go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg =
7
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a /go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY =
8
+ golang.org/x/text v0.3.0 /go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ =
9
+ golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ =
10
+ golang.org/x/tools v0.0.0-20190311212946-11955173bddd /go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs =
You can’t perform that action at this time.
0 commit comments