forked from oliver006/redis_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
175 lines (158 loc) · 4.07 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
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/oliver006/redis_exporter
services:
- name: redis5
image: redis:5
ports:
- 6379
- name: pwd-redis5
image: redis:5
commands:
- "/usr/local/bin/redis-server --port 6380 --requirepass redis-password"
ports:
- 6380
- name: redis-2-8
image: redis:2.8
commands:
- "/usr/local/bin/redis-server --port 6381"
ports:
- 6381
- name: redis-cluster
image: grokzen/redis-cluster
ports:
- 7000
- 7001
- 7002
- 7003
- 7004
- 7005
- name: tile38
image: tile38/tile38:latest
ports:
- 9851
steps:
- name: tests
image: "golang:1.13"
environment:
GO111MODULE: on
LOG_LEVEL: "info"
TEST_TILE38_URI: "redis://tile38:9851"
TEST_REDIS_URI: "redis://redis5:6379"
TEST_REDIS_2_8_URI: "redis://redis-2-8:6381"
TEST_PWD_REDIS_URI: "redis://h:redis-password@pwd-redis5:6380"
TEST_REDIS_CLUSTER_MASTER_URI: "redis://redis-cluster:7000"
TEST_REDIS_CLUSTER_SLAVE_URI: "redis://redis-cluster:7005"
COVERALLS_TOKEN:
from_secret: coveralls-token
commands:
- 'go build -mod=vendor'
- "sleep 10" # let the redis test instances all come up first
- 'go test -mod=vendor -v -covermode=atomic -cover -race -coverprofile=coverage.txt .'
- 'echo "checking gofmt"'
- 'echo " ! gofmt -d *.go 2>&1 | read " | bash'
- 'echo "checking gofmt - DONE"'
- 'go vet -mod=vendor .'
- 'go get github.com/mattn/goveralls'
- '/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io'
when:
event:
- pull_request
- push
- name: coverage-codecov
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- coverage.txt
when:
event:
- pull_request
- push
- name: release-docker-image-scratch
image: plugins/docker
settings:
tags: "latest,latest-amd64,${DRONE_TAG},${DRONE_TAG}-amd64"
dockerfile: ./docker/Dockerfile.amd64
repo: oliver006/redis_exporter
target: scratch
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
- 'GOARCH=amd64'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-docker-image-alpine-arm64
image: plugins/docker
settings:
tags: "latest-arm64,${DRONE_TAG}-arm64"
dockerfile: ./docker/Dockerfile.arm64
repo: oliver006/redis_exporter
target: alpine-arm64
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
- 'GOARCH=arm64'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-docker-image-alpine-arm
image: plugins/docker
settings:
tags: "latest-arm,${DRONE_TAG}-arm"
dockerfile: ./docker/Dockerfile.arm
repo: oliver006/redis_exporter
target: alpine-arm
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
- 'GOARCH=arm'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-docker-image-alpine-amd64
image: plugins/docker
settings:
tags: "alpine,${DRONE_TAG}-alpine"
dockerfile: ./docker/Dockerfile.amd64
repo: oliver006/redis_exporter
target: alpine
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
- 'GOARCH=amd64'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-github-binaries
image: "golang:1.13"
environment:
GITHUB_TOKEN:
from_secret: github_token
GO111MODULE: on
commands:
- "apt-get update && apt-get install -y zip"
- "./build-github-binaries.sh"
when:
event:
- tag