This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.drone.yml
134 lines (132 loc) · 2.65 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
---
kind: pipeline
name: durl
steps:
- name: list files
image: plugins/git
commands:
- git ls-files > list.txt
- name: durl
image: quay.io/suzuki_shunsuke/durl:1.0.0
commands:
- cat list.txt | durl check
---
kind: pipeline
name: shell scripts
clone:
depth: 1
steps:
- name: shellcheck
image: koalaman/shellcheck-alpine:v0.7.1
commands:
- apk add git
- sh scripts/shellcheck.sh
- name: shfmt
image: mvdan/shfmt:v3.1.2-alpine
commands:
- 'shfmt -d . env.sh.tmpl'
---
kind: pipeline
name: yamllint
steps:
- name: yamllint
image: quay.io/suzuki_shunsuke/yamllint:1.23.0
commands:
- apk add git
- sh scripts/yamllint.sh
---
kind: pipeline
name: jsonlint
steps:
- name: jsonlint
image: cytopia/jsonlint:1.6.0-0.5
commands:
- bash scripts/jsonlint.sh
---
kind: pipeline
name: terraform fmt (v0.12)
steps:
- name: terraform fmt (v0.12)
image: hashicorp/terraform:0.12.24
commands:
- terraform fmt -check examples/v0.12
- terraform fmt -check -recursive graylog/testdata
---
kind: pipeline
name: terraform fmt (v0.11)
steps:
- name: terraform fmt (v0.11)
image: hashicorp/terraform:0.11.14
commands:
- terraform fmt -check examples/v0.11
---
kind: pipeline
name: build
volumes:
- name: gopath
temp: {}
steps:
- name: download go modules
image: golang:1.15.3
commands:
- go mod download
volumes: &volumes
- name: gopath
path: /go
- name: golangci-lint
image: golangci/golangci-lint:v1.31.0-alpine
commands:
- cd graylog
- golangci-lint run
volumes: *volumes
- name: codecov
image: golang:1.15.3
commands:
# bash and cgo seem to be required
- bash scripts/codecov_test.sh
- curl -s https://codecov.io/bash > /tmp/codecov.sh
- test "$LOCAL" = "true" -o "$DRONE_BUILD_EVENT" = "pull_request" || bash /tmp/codecov.sh
volumes: *volumes
environment:
CODECOV_TOKEN:
from_secret: codecov_token
- name: remove changes
image: &image_git plugins/git
commands:
# Sometimes it is failed to release by goreleaser due to changes of go.sum
- git checkout -- .
- name: fetch tags to release
image: *image_git
commands:
- git fetch --tags
when:
event:
- tag
- name: release
image: goreleaser/goreleaser:v0.145.0
commands:
- goreleaser release
environment:
GITHUB_TOKEN:
from_secret: github_token
volumes: *volumes
when:
event:
- tag
- name: create a dummy tag to test releasing
image: *image_git
commands:
- git tag v0.1.0-alpha
when:
event:
- pull_request
- push
- name: release (skip-publish)
image: goreleaser/goreleaser:v0.145.0
commands:
- goreleaser release --skip-publish
volumes: *volumes
when:
event:
- pull_request
- push