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
22
3- MAINTAINER Code Climate <hello@codeclimate.com>
3+ LABEL maintainer="Code Climate <hello@codeclimate.com>"
4+
5+ RUN adduser -u 9000 -D app
46
57WORKDIR /usr/src/app
8+
9+ COPY engine.json /engine.json
610COPY codeclimate-golint.go /usr/src/app/codeclimate-golint.go
7- COPY DATE_BUILT /usr/src/app/DATE_BUILT
811
9- RUN apk --update add go git && \
12+ RUN apk add --no-cache --virtual .dev-deps musl-dev go git && \
1013 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 && \
1216 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"
1619
20+ USER app
1721WORKDIR /code
1822VOLUME /code
1923
20- RUN adduser -u 9000 -D app
21- USER app
22-
2324CMD ["/usr/local/bin/codeclimate-golint" ]
Original file line number Diff line number Diff line change 1- .PHONY : image
1+ .PHONY : update image
22
33IMAGE_NAME ?= codeclimate/codeclimate-golint
44
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
614 docker build --rm -t $(IMAGE_NAME ) .
Original file line number Diff line number Diff line change @@ -28,14 +28,20 @@ engines:
2828### Building
2929
3030` ` ` console
31- docker build -t codeclimate/codeclimate-golint .
31+ make image
3232```
3333
3434### Updating
3535
3636` 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.
3945
4046### Need help?
4147
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