-
Notifications
You must be signed in to change notification settings - Fork 5
/
.drone.yml
122 lines (110 loc) · 2.62 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
kind: pipeline
name: test
steps:
- name: test
image: "golang:1.15-alpine"
environment:
CGO_ENABLED: 0
commands:
- 'echo " ! gofmt -d *.go 2>&1 | read " | ash'
- "go vet ./..."
- "go build"
- "go test -v"
- name: datadog
image: "masci/drone-datadog"
settings:
api_key:
from_secret: datadog_api_key
dry_run: false
metrics:
- type: "count"
name: "masci.pipelines.count"
value: 1.0
tags: ["project:${DRONE_REPO_NAME}", "branch:${DRONE_BRANCH}"]
host: ${DRONE_SYSTEM_HOSTNAME}
---
kind: pipeline
name: unstable
steps:
# Build the current commit
- name: build
image: plugins/docker
settings:
repo: masci/drone-datadog
build_args:
- "TAG=$unstable"
- "SHA1=${DRONE_COMMIT_SHA}"
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- unstable
# Use unstable to test the plugin
- name: datadog
image: "masci/drone-datadog:unstable"
settings:
api_key:
from_secret: datadog_api_key
dry_run: false
metrics:
- type: "count"
name: "masci.pipelines.count"
value: 1.0
tags: ["project:${DRONE_REPO_NAME}", "branch:${DRONE_BRANCH}"]
host: ${DRONE_SYSTEM_HOSTNAME}
events:
- title: "Building drone-datadog for commit ${DRONE_COMMIT_SHA} success"
text: "Version 'unstable' is available on Docker Hub"
alert_type: "info"
host: ${DRONE_SYSTEM_HOSTNAME}
priority: "low"
aggregation_key: "unstable-build"
trigger:
branch:
- master
depends_on:
- test
---
kind: pipeline
name: release
steps:
- name: fetch
# extra step needed to fetch tags after cloning
image: docker:git
commands:
- git fetch --tags
- name: build
image: plugins/docker
settings:
repo: masci/drone-datadog
build_args:
- "TAG=${DRONE_TAG}"
- "SHA1=${DRONE_COMMIT_SHA}"
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- latest
- ${DRONE_TAG}
- name: datadog
image: "masci/drone-datadog:${DRONE_TAG}"
settings:
api_key:
from_secret: datadog_api_key
events:
- title: "Building drone-datadog success"
text: "Version ${DRONE_TAG} is available on Docker Hub"
alert_type: "info"
host: ${DRONE_SYSTEM_HOSTNAME}
trigger:
event:
- tag
status:
- success
ref:
include:
- refs/tags/v*
depends_on:
- test