File tree Expand file tree Collapse file tree 6 files changed +59
-17
lines changed Expand file tree Collapse file tree 6 files changed +59
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- FROM alpine:3.4
1
+ FROM alpine:edge
2
2
3
- MAINTAINER Code Climate <hello@codeclimate.com>
3
+ LABEL maintainer="Code Climate <hello@codeclimate.com>"
4
+
5
+ RUN adduser -u 9000 -D app
4
6
5
7
WORKDIR /usr/src/app
8
+
9
+ COPY engine.json /engine.json
6
10
COPY codeclimate-golint.go /usr/src/app/codeclimate-golint.go
7
- COPY DATE_BUILT /usr/src/app/DATE_BUILT
8
11
9
- RUN apk --update add go git && \
12
+ RUN apk add --no-cache --virtual .dev-deps musl-dev go git && \
10
13
export GOPATH=/tmp/go GOBIN=/usr/local/bin && \
11
- go get -d . && \
14
+ go get -d -t -v . && \
15
+ export LIBRARY_PATH=/usr/lib32:$LIBRARY_PATH && \
12
16
go install codeclimate-golint.go && \
13
- apk del go git && \
14
- rm -rf "$GOPATH" && \
15
- rm /var/cache/apk/*
17
+ apk del .dev-deps && \
18
+ rm -rf "$GOPATH"
16
19
20
+ USER app
17
21
WORKDIR /code
18
22
VOLUME /code
19
23
20
- RUN adduser -u 9000 -D app
21
- USER app
22
-
23
24
CMD ["/usr/local/bin/codeclimate-golint" ]
Original file line number Diff line number Diff line change 1
- .PHONY : image
1
+ .PHONY : update image
2
2
3
3
IMAGE_NAME ?= codeclimate/codeclimate-golint
4
4
5
- image :
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
6
14
docker build --rm -t $(IMAGE_NAME ) .
Original file line number Diff line number Diff line change @@ -28,14 +28,20 @@ engines:
28
28
### Building
29
29
30
30
` ` ` console
31
- docker build -t codeclimate/codeclimate-golint .
31
+ make image
32
32
```
33
33
34
34
### Updating
35
35
36
36
` golint ` doesn't version releases, so in order to get the latest version & force
37
- a new docker image build, we have a ` DATE_BUILT ` file: to force an update of
38
- golint, run ` date > DATE_BUILT ` locally & then rebuild the docker image.
37
+ a new docker image build, we have to update the ` engine.json ` file.
38
+
39
+ ``` console
40
+ make update
41
+ ```
42
+
43
+ This will update the engine version with the latest ` golint ` version. After that
44
+ rebuild the image as usually.
39
45
40
46
### Need help?
41
47
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ apk add --no-cache curl jq
6
+ head_sha=$(
7
+ curl -s $(
8
+ curl -s " https://api.github.com/repos/golang/lint/git/refs/heads/master" |
9
+ jq -r .object.url
10
+ ) |
11
+ jq -r .sha
12
+ )
13
+ full_version=" $( jq -r .version /engine.json | cut -d / -f 1) /${head_sha} "
14
+ jq " .version=\" ${full_version} \" " /engine.json > /tmp/engine.json &&
15
+ cat /tmp/engine.json > /engine.json
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " golint" ,
3
+ "description" : " Golint is a linter for Go source code." ,
4
+ "maintainer" : {
5
+ "name" : " Code Climate" ,
6
+ "email" : " hello@codeclimate.com"
7
+ },
8
+ "languages" : [
9
+ " Go"
10
+ ],
11
+ "version" : " 1.0.0/6aaf7c34af0f4c36a57e0c429bace4d706d8e931" ,
12
+ "spec_version" : " 0.3.1"
13
+ }
You can’t perform that action at this time.
0 commit comments