-
Notifications
You must be signed in to change notification settings - Fork 71
/
.drone.yml
93 lines (84 loc) · 2.47 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
kind: pipeline
name: default
platform:
os: linux
arch: amd64
workspace:
base: /go
path: src/github.com/justinbarrick/fluxcloud
steps:
- name: build
image: golang:1.10-alpine
commands:
- apk update && apk add make git
- make test
- make build
when:
event: [push,tag]
- name: publish-dev
image: plugins/docker
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
settings:
repo: justinbarrick/fluxcloud
tags:
- ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:7}
when:
event: push
- name: publish
image: plugins/docker
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
settings:
repo: justinbarrick/fluxcloud
tags:
- ${DRONE_TAG}
- latest
when:
event: tag
- name: github_release
image: plugins/github-release
environment:
github_token:
from_secret: github_token
settings:
files:
- fluxcloud
checksum:
- sha256
when:
event: tag
- name: slack
image: plugins/slack
settings:
webhook: https://hooks.slack.com/services/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
channel: '#kubernetes'
username: Drone CI
icon_url: https://i.imgur.com/B7Tk2Xf.png
template: >
{{#success build.status}}
Build <{{build.link}}|#{{build.number}}> for <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.commit}}|{{repo.name}}#{{build.branch}}> by {{build.author}} succeeded!
{{else}}
Build <{{build.link}}|#{{build.number}}> for <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.commit}}|{{repo.name}}#{{build.branch}}> by {{build.author}} failed.
{{/success}}
when:
status: [success, failure]
event: [push,tag]
- name: slack2
image: plugins/slack
settings:
webhook: https://hooks.slack.com/services/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
channel: '#kubernetes'
username: Fluxcloud Release Bot
icon_url: https://i.imgur.com/B7Tk2Xf.png
template: >
Released ${DRONE_TAG} to <https://github.com/{{repo.owner}}/{{repo.name}}/releases/tag/${DRONE_TAG}|Github>.
Pushed <https://hub.docker.com/r/{{repo.owner}}/{{repo.name}}|{{repo.owner}}/{{repo.name}}:${DRONE_TAG}> to Dockerhub.
when:
event: tag