-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
80 lines (69 loc) · 1.89 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
# Secrets that must be set in drone.io:
# GITHUB_TOKEN_DRONE (scope required: repo/public_repo)
# CODECOV_TOKEN from codecov.io
# Docker credentials:
# DOCKER_USERNAME
# DOCKER_PASSWORD
kind: pipeline
name: default
platform:
os: linux
arch: amd64
trigger:
event:
exclude:
- pull_request
services:
- name: etcd
image: quay.io/coreos/etcd:v3.3
entrypoint:
- /usr/local/bin/etcd
command:
- '--name=etcd'
- '--initial-advertise-peer-urls=http://etcd:2380'
- '--listen-peer-urls=http://0.0.0.0:2380'
- '--listen-client-urls=http://0.0.0.0:2379'
- '--advertise-client-urls=http://etcd:2379'
- '--initial-cluster-token=s0m383cretT0k3n'
- '--heartbeat-interval=250'
- '--election-timeout=1250'
- '--initial-cluster=etcd=http://etcd:2380'
- '--initial-cluster-state=new'
steps:
# Goreleaser needs at least the last two tags.
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: tests
image: golang
environment:
GO111MODULE: on
CODECOV_TOKEN: { from_secret: CODECOV_TOKEN }
ETCD_ENDPOINTS: "http://etcd:2379"
commands:
- go build -v ./...
- go test -coverpkg=./... -race -covermode=atomic -tags integration -coverprofile=coverage.txt ./...
- curl -s https://codecov.io/bash | bash
- name: cqserver_docker
image: plugins/docker
settings:
dockerfile: cmd/cq/Dockerfile
repo: jozuenoon/message_bus
auto_tag: true
username: { from_secret: DOCKER_USERNAME }
password: { from_secret: DOCKER_PASSWORD }
when:
event:
- tag
- name: release
image: goreleaser/goreleaser:latest
commands:
- git diff
- goreleaser release --rm-dist --skip-validate
environment:
GO111MODULE: on
GITHUB_TOKEN: { from_secret: GITHUB_TOKEN_DRONE }
when:
event:
- tag