-
Notifications
You must be signed in to change notification settings - Fork 24
/
.drone.yml
341 lines (340 loc) · 7.38 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
---
image_pull_secrets:
- docker_config_json
kind: pipeline
name: build
steps:
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine
name: runner identification
- commands:
- make deps
- ./scripts/enforce-clean
depends_on:
- runner identification
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: deps
- commands:
- make lint
depends_on:
- deps
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: lint
- commands:
- git fetch origin --tags
- git status --porcelain --untracked-files=no
- git diff --no-ext-diff --quiet
- ./scripts/version
- ./scripts/generate-tags > .tags
- make build
depends_on:
- deps
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: build
- commands:
- make test
depends_on:
- lint
- build
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: test
- commands: []
depends_on:
- build
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker build (linux/amd64)
settings:
build_args:
- TARGETPLATFORM=linux/amd64
- TARGETOS=linux
- TARGETARCH=amd64
dry_run: "true"
repo: grafana/synthetic-monitoring-agent
target: release
- commands: []
depends_on:
- build
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker build (linux/arm64/v8)
settings:
build_args:
- TARGETPLATFORM=linux/arm64/v8
- TARGETOS=linux
- TARGETARCH=arm64
- TARGETVARIANT=v8
dry_run: "true"
repo: grafana/synthetic-monitoring-agent
target: release
- commands: []
depends_on:
- build
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker build (with browser) (linux/amd64)
settings:
build_args:
- TARGETPLATFORM=linux/amd64
- TARGETOS=linux
- TARGETARCH=amd64
dry_run: "true"
repo: grafana/synthetic-monitoring-agent
target: with-browser
- commands:
- "true"
depends_on:
- docker build (linux/amd64)
- docker build (with browser) (linux/amd64)
- docker build (linux/arm64/v8)
image: alpine
name: docker build
- commands: []
depends_on:
- test
- docker build
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker publish to gcr.io (linux/amd64)
settings:
config:
from_secret: docker_config_json
dry_run: "false"
repo: us.gcr.io/kubernetes-dev/synthetic-monitoring-agent
target: release
when:
ref:
- refs/heads/main
- refs/tags/v*.*.*
- commands: []
depends_on:
- test
- docker build
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker publish to docker (linux/amd64)
settings:
dry_run: "false"
password:
from_secret: docker_password
repo: grafana/synthetic-monitoring-agent
target: release
username:
from_secret: docker_username
when:
ref:
- refs/tags/v*.*.*
- commands:
- "true"
depends_on:
- docker publish to gcr.io (linux/amd64)
image: alpine
name: docker publish (dev)
when:
ref:
- refs/heads/main
- refs/tags/v*.*.*
- commands:
- "true"
depends_on:
- docker publish to gcr.io (linux/amd64)
- docker publish to docker (linux/amd64)
image: alpine
name: docker publish (release)
when:
ref:
- refs/tags/v*.*.*
- commands:
- ./scripts/generate-tags browser > .tags
depends_on:
- docker publish (release)
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: docker publish (with browser) tags
- commands: []
depends_on:
- docker publish (with browser) tags
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
name: docker publish (with browser) to docker (linux/amd64)
settings:
dry_run: "false"
password:
from_secret: docker_password
repo: grafana/synthetic-monitoring-agent
target: with-browser
username:
from_secret: docker_username
when:
ref:
- refs/tags/v*.*.*
- commands:
- "true"
depends_on:
- docker publish (with browser) to docker (linux/amd64)
image: alpine
name: docker publish (with browser) (release)
when:
ref:
- refs/tags/v*.*.*
- commands: []
depends_on:
- docker publish (release)
image: us.gcr.io/kubernetes-dev/drone/plugins/argo-cli
name: trigger argo workflow (release)
settings:
add_ci_labels: true
command: 'submit --from workflowtemplate/deploy-synthetic-monitoring-agent --name
deploy-synthetic-monitoring-agent-release-$(./scripts/version) --parameter mode=release
--parameter dockertag=$(./scripts/version) --parameter commit=${DRONE_COMMIT}
--parameter commit_author=${DRONE_COMMIT_AUTHOR} --parameter commit_link=${DRONE_COMMIT_LINK} '
namespace: synthetic-monitoring-cd
token:
from_secret: argo_token
when:
ref:
- refs/tags/v*.*.*
trigger:
ref:
- refs/heads/main
- refs/pull/**
- refs/tags/v*.*.*
type: docker
---
image_pull_secrets:
- docker_config_json
kind: pipeline
name: release
services:
- image: jrei/systemd-debian:12
name: systemd-debian
privileged: true
volumes:
- name: cgroup
path: /sys/fs/cgroup
- image: jrei/systemd-centos:8
name: systemd-centos
privileged: true
volumes:
- name: cgroup
path: /sys/fs/cgroup
steps:
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine
name: runner identification
- commands:
- git fetch --tags
image: docker:git
name: fetch
- commands:
- printf "%s" "$NFPM_SIGNING_KEY" > $NFPM_SIGNING_KEY_FILE
environment:
NFPM_SIGNING_KEY:
from_secret: gpg_private_key
NFPM_SIGNING_KEY_FILE: /drone/src/release-private-key.key
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: write-key
- commands:
- make release-snapshot
environment:
NFPM_DEFAULT_PASSPHRASE:
from_secret: gpg_passphrase
NFPM_SIGNING_KEY_FILE: /drone/src/release-private-key.key
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: test release
- commands:
- ./scripts/package/verify-deb-install.sh
image: docker
name: test deb package
privileged: true
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./scripts/package/verify-rpm-install.sh
image: docker
name: test rpm package
privileged: true
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- make release
environment:
GITHUB_TOKEN:
from_secret: gh_token
NFPM_DEFAULT_PASSPHRASE:
from_secret: gpg_passphrase
NFPM_SIGNING_KEY_FILE: /drone/src/release-private-key.key
image: ghcr.io/grafana/grafana-build-tools:v0.31.1
name: release
when:
ref:
- refs/tags/v*.*.*
trigger:
ref:
- refs/pull/**
- refs/tags/v*.*.*
repo:
- grafana/*
type: docker
volumes:
- host:
path: /sys/fs/cgroup
name: cgroup
- host:
path: /var/run/docker.sock
name: docker
---
get:
name: username
path: infra/data/ci/docker_hub
kind: secret
name: docker_username
---
get:
name: password
path: infra/data/ci/docker_hub
kind: secret
name: docker_password
---
get:
name: .dockerconfigjson
path: infra/data/ci/gcr-admin
kind: secret
name: docker_config_json
---
get:
name: token
path: infra/data/ci/argo-workflows/trigger-service-account
kind: secret
name: argo_token
---
get:
name: pat
path: infra/data/ci/github/grafanabot
kind: secret
name: gh_token
---
get:
name: passphrase
path: infra/data/ci/packages-publish/gpg
kind: secret
name: gpg_passphrase
---
get:
name: private-key
path: infra/data/ci/packages-publish/gpg
kind: secret
name: gpg_private_key
---
kind: signature
hmac: ebba11ba346f14c3e83c6ed062a09e816f74e904269e3191d9863961f86c27d8
...