Skip to content

Commit 7ed6bb2

Browse files
ibuildthecloudyasker
authored andcommitted
Update to latest go-skel based build scripts
1 parent ba43bcd commit 7ed6bb2

17 files changed

+351
-138
lines changed

Diff for: .dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
./.dapper
2+
./.cache
3+
./dist

Diff for: .drone.yml

+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
---
2+
kind: pipeline
3+
name: amd64
4+
5+
platform:
6+
os: linux
7+
arch: amd64
8+
9+
steps:
10+
- name: build
11+
image: rancher/dapper:v0.4.1
12+
commands:
13+
- dapper ci
14+
volumes:
15+
- name: docker
16+
path: /var/run/docker.sock
17+
18+
- name: github_binary_release
19+
image: plugins/github-release
20+
settings:
21+
api_key:
22+
from_secret: github_token
23+
prerelease: true
24+
checksum:
25+
- sha256
26+
checksum_file: CHECKSUMsum-amd64.txt
27+
checksum_flatten: true
28+
files:
29+
- "dist/artifacts/*"
30+
when:
31+
instance:
32+
- drone-publish.rancher.io
33+
ref:
34+
- refs/head/master
35+
- refs/tags/*
36+
event:
37+
- tag
38+
39+
- name: docker-publish
40+
image: plugins/docker
41+
settings:
42+
dockerfile: package/Dockerfile
43+
password:
44+
from_secret: docker_password
45+
repo: "rancher/local-path-provisioner"
46+
tag: "${DRONE_TAG}-amd64"
47+
username:
48+
from_secret: docker_username
49+
when:
50+
instance:
51+
- drone-publish.rancher.io
52+
ref:
53+
- refs/head/master
54+
- refs/tags/*
55+
event:
56+
- tag
57+
58+
volumes:
59+
- name: docker
60+
host:
61+
path: /var/run/docker.sock
62+
63+
---
64+
kind: pipeline
65+
name: arm64
66+
67+
platform:
68+
os: linux
69+
arch: arm64
70+
71+
steps:
72+
- name: build
73+
image: rancher/dapper:v0.4.1
74+
commands:
75+
- dapper ci
76+
volumes:
77+
- name: docker
78+
path: /var/run/docker.sock
79+
80+
- name: github_binary_release
81+
image: plugins/github-release
82+
settings:
83+
api_key:
84+
from_secret: github_token
85+
prerelease: true
86+
checksum:
87+
- sha256
88+
checksum_file: CHECKSUMsum-arm64.txt
89+
checksum_flatten: true
90+
files:
91+
- "dist/artifacts/*"
92+
when:
93+
instance:
94+
- drone-publish.rancher.io
95+
ref:
96+
- refs/head/master
97+
- refs/tags/*
98+
event:
99+
- tag
100+
101+
- name: docker-publish
102+
image: plugins/docker
103+
settings:
104+
dockerfile: package/Dockerfile
105+
password:
106+
from_secret: docker_password
107+
repo: "rancher/local-path-provisioner"
108+
tag: "${DRONE_TAG}-arm64"
109+
username:
110+
from_secret: docker_username
111+
when:
112+
instance:
113+
- drone-publish.rancher.io
114+
ref:
115+
- refs/head/master
116+
- refs/tags/*
117+
event:
118+
- tag
119+
120+
volumes:
121+
- name: docker
122+
host:
123+
path: /var/run/docker.sock
124+
125+
---
126+
kind: pipeline
127+
name: arm
128+
129+
platform:
130+
os: linux
131+
arch: arm
132+
133+
steps:
134+
- name: build
135+
image: rancher/dapper:v0.4.1
136+
commands:
137+
- dapper ci
138+
volumes:
139+
- name: docker
140+
path: /var/run/docker.sock
141+
142+
- name: github_binary_release
143+
image: plugins/github-release
144+
settings:
145+
api_key:
146+
from_secret: github_token
147+
prerelease: true
148+
checksum:
149+
- sha256
150+
checksum_file: CHECKSUMsum-arm.txt
151+
checksum_flatten: true
152+
files:
153+
- "dist/artifacts/*"
154+
when:
155+
instance:
156+
- drone-publish.rancher.io
157+
ref:
158+
- refs/head/master
159+
- refs/tags/*
160+
event:
161+
- tag
162+
163+
- name: docker-publish
164+
image: plugins/docker
165+
settings:
166+
dockerfile: package/Dockerfile
167+
password:
168+
from_secret: docker_password
169+
repo: "rancher/local-path-provisioner"
170+
tag: "${DRONE_TAG}-arm"
171+
username:
172+
from_secret: docker_username
173+
when:
174+
instance:
175+
- drone-publish.rancher.io
176+
ref:
177+
- refs/head/master
178+
- refs/tags/*
179+
event:
180+
- tag
181+
182+
volumes:
183+
- name: docker
184+
host:
185+
path: /var/run/docker.sock
186+
187+
---
188+
kind: pipeline
189+
name: manifest
190+
191+
platform:
192+
os: linux
193+
arch: amd64
194+
195+
steps:
196+
- name: manifest
197+
image: plugins/manifest:1.0.2
198+
settings:
199+
username:
200+
from_secret: docker_username
201+
password:
202+
from_secret: docker_password
203+
platforms:
204+
- linux/amd64
205+
- linux/arm64
206+
- linux/arm
207+
target: "rancher/local-path-provisioner:${DRONE_TAG}"
208+
template: "rancher/local-path-provisioner:${DRONE_TAG}-ARCH"
209+
when:
210+
instance:
211+
- drone-publish.rancher.io
212+
ref:
213+
- refs/head/master
214+
- refs/tags/*
215+
event:
216+
- tag
217+
218+
depends_on:
219+
- amd64
220+
- arm64
221+
- arm

Diff for: .gitignore

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
# Binaries for programs and plugins
2-
*.exe
3-
*.exe~
4-
*.dll
5-
*.so
6-
*.dylib
7-
8-
# Test binary, build with `go test -c`
9-
*.test
10-
11-
# Output of the go coverage tool, specifically when used with LiteIDE
12-
*.out
13-
14-
*dapper*
15-
!Dockerfile.dapper
16-
bin/
1+
/.dapper
2+
/.cache
3+
/bin
4+
/dist
5+
*.swp
6+
.idea

Diff for: .golangci.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"linters": {
3+
"disable-all": true,
4+
"enable": [
5+
"govet",
6+
"golint",
7+
"goimports",
8+
"misspell",
9+
"ineffassign",
10+
"gofmt"
11+
]
12+
},
13+
"run": {
14+
"skip-files": [
15+
"/zz_generated_"
16+
],
17+
"deadline": "5m"
18+
}
19+
}

Diff for: Dockerfile.dapper

+22-29
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
FROM ubuntu:16.04
2-
# FROM arm=armhf/ubuntu:16.04
3-
4-
ARG DAPPER_HOST_ARCH=amd64
5-
ARG http_proxy
6-
ARG https_proxy
7-
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
8-
9-
RUN apt-get update && \
10-
apt-get install -y gcc ca-certificates git wget curl vim less file python-tox python-dev && \
11-
rm -f /bin/sh && ln -s /bin/bash /bin/sh
12-
13-
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
14-
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
15-
DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \
16-
DOCKER_URL=DOCKER_URL_${ARCH}
17-
18-
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
19-
20-
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
21-
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
22-
23-
RUN wget -O - https://storage.googleapis.com/golang/go1.12.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local
24-
RUN go get github.com/rancher/trash && go get golang.org/x/lint/golint
25-
26-
ENV DAPPER_SOURCE /go/src/github.com/rancher/local-path-provisioner
27-
ENV DAPPER_OUTPUT ./bin
1+
FROM golang:1.12.1-alpine3.9
2+
3+
ARG DAPPER_HOST_ARCH
4+
ENV ARCH $DAPPER_HOST_ARCH
5+
6+
RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
7+
RUN go get -d golang.org/x/lint/golint && \
8+
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
9+
go install golang.org/x/lint/golint && \
10+
rm -rf /go/src /go/pkg
11+
RUN mkdir -p /go/src/golang.org/x && \
12+
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
13+
git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
14+
go install golang.org/x/tools/cmd/goimports
15+
RUN rm -rf /go/src /go/pkg
16+
RUN if [ "${ARCH}" == "amd64" ]; then \
17+
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
18+
fi
19+
20+
ENV DAPPER_ENV REPO TAG DRONE_TAG
21+
ENV DAPPER_SOURCE /go/src/github.com/rancher/local-path-provisioner/
22+
ENV DAPPER_OUTPUT ./bin ./dist
2823
ENV DAPPER_DOCKER_SOCKET true
29-
ENV DAPPER_ENV IMAGE REPO VERSION TAG
30-
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
3124
ENV HOME ${DAPPER_SOURCE}
3225
WORKDIR ${DAPPER_SOURCE}
3326

Diff for: LICENSE

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Apache License
23
Version 2.0, January 2004
34
http://www.apache.org/licenses/
@@ -174,28 +175,3 @@
174175
of your accepting any such warranty or additional liability.
175176

176177
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

Diff for: Makefile

+1-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ TARGETS := $(shell ls scripts)
1010
$(TARGETS): .dapper
1111
./.dapper $@
1212

13-
trash: .dapper
14-
./.dapper -m bind trash
15-
16-
trash-keep: .dapper
17-
./.dapper -m bind trash -k
18-
19-
deps: trash
20-
21-
.DEFAULT_GOAL := ci
13+
.DEFAULT_GOAL := default
2214

2315
.PHONY: $(TARGETS)

Diff for: package/Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
FROM alpine:latest
2-
3-
COPY bin /bin
4-
5-
ENTRYPOINT ["/bin/local-path-provisioner"]
1+
FROM alpine
2+
COPY bin/local-path-provisioner /usr/bin/
3+
CMD ["local-path-provisioner"]

0 commit comments

Comments
 (0)