forked from oliver006/redis_exporter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.drone.yml
131 lines (118 loc) · 2.98 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
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/oliver006/redis_exporter
services:
- name: redis
image: redis:5
ports:
- 6379
- name: pwd-redis
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.12"
environment:
GO111MODULE: on
LOG_LEVEL: "info"
TEST_TILE38_URI: "redis://tile38:9851"
TEST_REDIS_URI: "redis://redis:6379"
TEST_REDIS_2_8_URI: "redis://redis-2-8:6381"
TEST_PWD_REDIS_URI: "redis://h:redis-password@pwd-redis: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 .'
- '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