forked from oliver006/redis_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
148 lines (133 loc) · 3.34 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
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/oliver006/redis_exporter
services:
- name: redis
image: redis:5
ports:
- 6379
- name: moar-redis
image: redis:5
commands:
- /usr/local/bin/redis-server --port 6380
ports:
- 6380
- 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.12"
environment:
GO111MODULE: on
LOG_LEVEL: "info"
TEST_TILE38_URI: "tile38:9851"
TEST_SECOND_REDIS_URI: "redis://moar-redis:6380"
TEST_REDIS_CLUSTER_MASTER_URI: "redis-cluster:7000"
TEST_REDIS_CLUSTER_SLAVE_URI: "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 ./exporter/... --redis.addr=redis'
- 'echo "checking gofmt"'
- 'echo " ! gofmt -d main.go 2>&1 | read " | bash'
- 'echo " ! gofmt -d exporter/*.go 2>&1 | read " | bash'
- 'echo "checking gofmt - DONE"'
- 'go vet ./exporter/...'
- 'go get github.com/mattn/goveralls'
- '/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io'
when:
event:
- pull_request
- name: coverage-codecov
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- coverage.txt
when:
event:
- pull_request
- name: release-docker-image-scratch
image: plugins/docker
settings:
tags: "latest,${DRONE_TAG}"
dockerfile: ./Dockerfile
repo: oliver006/redis_exporter
target: scratch
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-docker-image-alpine
image: plugins/docker
settings:
tags: "latest,${DRONE_TAG}-alpine"
dockerfile: ./Dockerfile
repo: oliver006/redis_exporter
target: alpine
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
event:
- tag
- name: release-github-binaries
image: "golang:1.12"
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
#
# temporary addtl. build step while working on #256
#
- name: release-docker-image-alpine-v1.0.0-rc.1
image: plugins/docker
settings:
tags: "v1.0.0-rc.1"
dockerfile: ./Dockerfile
repo: oliver006/redis_exporter
target: alpine
build_args:
- 'TAG=v1.0.0-rc.1'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_user
password:
from_secret: docker_pass
when:
branch:
- oh_1.0_here_we_come
repo:
- oliver006/redis_exporter