-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.drone.yml
executable file
·69 lines (67 loc) · 1.92 KB
/
example.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
kind: pipeline
type: docker
name: testing
trigger:
branch:
- main
event:
- push
steps:
- name: yamllint
image: cytopia/yamllint
pull: if-not-exists
commands:
- yamllint -d .yamllint.config *.yaml automations/*.yaml
- name: home assistant config test
image: homeassistant/home-assistant:latest
pull: if-not-exists
commands:
- mv geolocation-drone.yaml geolocation.yaml
- mv configuration-drone.yaml configuration.yaml
- python -m homeassistant --script check_config --config .
- name: findmissing
image: findmissing
pull: if-not-exists
settings:
HASS_SERVER:
from_secret: HASS_SERVER
HASS_TOKEN:
from_secret: HASS_TOKEN
commands:
- cd automations
- python3 find_missing.py
- name: reload automations
image: kuchel77/drone-webhook #note this is a build of the webhook image that doesn't send a body request
pull: never
settings:
bearer:
from_secret: HASS_TOKEN
urls: http://hassio:8123/api/services/automation/reload
debug: true
failure: ignore
- name: notify
image: plugins/slack
settings:
webhook:
channel: general
icon_url: https://unsplash.it/256/256/?random
template: >
{{#success build.status}}
Home Assistant - Build {{build.number}} succeeded. Good job.
{{else}}
Home Assistant - Build {{build.number}} failed. Fix me please.
{{/success}}
username: drone
when:
status: [ success, failure ]
- name: send
image: plugins/webhook #runs an automation depending on the build status. Changes light letting me know if it works
settings:
urls:
- http://hassio:8123/api/webhook/drone_build
content_type: application/json
template: |
{ "repo": "{{ repo.name }}", "status": "{{ build.status }}"}
debug: true
when:
status: [success, failure]