forked from do-community/hello_hapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
78 lines (69 loc) · 1.83 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
---
kind: pipeline
name: default
steps:
- name: build
image: node:latest
commands:
- npm install
# - name: test
# image: node:latest
# commands:
# - npm run test
- name: db-ping
image: postgres:10.4
# depends_on:
# - database
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: password
commands:
# wait for postgres service to become available
- |
until psql -U app -d app -h database \
-c "SELECT 1;" >/dev/null 2>&1; do sleep 1; done
# query the database
- |
psql -U app -d app -h database \
-c "SELECT * FROM pg_catalog.pg_tables;"
# max connections
- |
psql -U app -d app -h database \
-c "show max_connections;"
- name: test-00
image: node:latest
commands:
- exit 0
- name: test-01
image: node:latest
commands:
- exit 1
- name: notify
image: plugins/slack
depends_on:
- test-00
- test-01
settings:
webhook:
from_secret: tnomatter_webhook
channel: testing-bot
username: drone
icon_emoji: drone
when:
status: [ success, failure ]
template: >
{{#success build.status}}
{{repo.name}} ({{build.branch}}) <{{ build.link }}|{{ repo.owner }}/{{ repo.name }}#{{truncate build.commit 8}}> build succeeded on {{uppercasefirst build.event}}. Good job {{ build.author }}.
{{else}}
{{repo.name}} ({{build.branch}}) <{{ build.link }}|{{ repo.owner }}/{{ repo.name }}#{{truncate build.commit 8}}> build failed on {{uppercasefirst build.event}}. Fix me please {{ build.author }}.
{{/success}}
services:
- name: database
image: postgres:10.4
environment:
POSTGRES_USER: app
# POSTGRES_PASSWORD: password
# when:
# event: [pull_request, push]
# branch: master
---