-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
105 lines (98 loc) · 2.58 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
---
kind: pipeline
name: default
steps:
- name: Go test
image: golang:1.18
environment:
GO111MODULE: "on"
COVER_OUT: cover.out
commands:
- go clean -testcache
- go test ./... --cover -coverprofile $COVER_OUT
- name: Go coverage
image: golang:1.18
environment:
GO111MODULE: "on"
COVER_OUT: cover.out
ANALYTICS_DATABASE_HOST: pg.opendax.app
ANALYTICS_DATABASE_PORT: 30432
ANALYTICS_DATABASE_USERNAME: postgres
ANALYTICS_DATABASE_USERNAME: coverage_analytics
ANALYTICS_DATABASE_PASSWORD:
from_secret: pgpass_coverage
ANALYTICS_DATABASE_NAME: coverage_analytics
ANALYTICS_COMPONENT: goci
commands:
- apt-get update
- apt-get install -y p7zip-full
- |
curl -s -L "https://github.com/boumenot/gocover-cobertura/releases/download/v1.1.0/gocover-cobertura.linux.x64.7z" -o ./gocover-cobertura.7z
curl -s -L https://github.com/openware/go-coverage/releases/download/v1.0.0-alpha/go-coverage -o ./go-coverage
7z x ./gocover-cobertura.7z
chmod +x ./gocover-cobertura
chmod +x ./go-coverage
- ./gocover-cobertura < $COVER_OUT > coverage.xml
- ./go-coverage coverage.xml
when:
event:
- tag
- name: Bump and tag
image: golang:1.14
environment:
GITHUB_API_KEY:
from_secret: gh_api_key
GITHUB_API_USER:
from_secret: gh_api_user
commands:
- git config --global user.name "Kite Bot"
- git config --global user.email "[email protected]"
- go get github.com/guilhem/bump
- git remote add authenticated-origin https://$GITHUB_API_USER:[email protected]/$DRONE_REPO
- git fetch --tags authenticated-origin
- bump patch --allow-dirty > .tags
- git push authenticated-origin --tags
when:
event:
- push
branch:
- master
- name: Build binary
image: golang:1.14
commands:
- echo $DRONE_TAG > .tags
- make all
when:
event:
- tag
branch:
- master
- name: Publish
image: plugins/github-release
settings:
api_key:
from_secret: gh_api_key
files: bin/*
when:
event:
- tag
branch:
- master
- name: Build container
image: plugins/docker
settings:
username:
from_secret: quay_username
password:
from_secret: quay_password
repo: quay.io/openware/goci
registry: quay.io
when:
event:
- push
branch:
- master
trigger:
event:
- push
- tag