-
Notifications
You must be signed in to change notification settings - Fork 6
/
.drone.yml
190 lines (177 loc) · 4.97 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
pipeline:
staging-build:
image: node:12-alpine
commands:
- export GRAPHQL_URL=https://api-v2.staging.bonde.org/graphql
- yarn global add pnpm
- pnpm i
- pnpm run lint
- pnpm m run test
- pnpm m run build
when:
event: [push]
staging-beta-publish:
image: plugins/docker
repo: nossas/bonde-bot-beta
secrets: [ docker_username, docker_password ]
username: lpirola
password: ${DOCKER_PASSWORD}
dockerfile: packages/beta/Dockerfile
group: publishing
tags:
- ${DRONE_BRANCH/\//-}
when:
status: success
branch: [hotfix/*, feature/*, develop]
staging-chatbot-publish:
image: plugins/docker
repo: nossas/bonde-bot-chatbot
secrets: [ docker_username, docker_password ]
username: lpirola
password: ${DOCKER_PASSWORD}
dockerfile: packages/chatbot/Dockerfile
group: publishing
tags:
- ${DRONE_BRANCH/\//-}
when:
status: success
branch: [hotfix/*, feature/*, develop]
staging-beta-webserver-deploy:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: webservers/beta
group: deploying
docker_image: nossas/bonde-bot-beta:${DRONE_BRANCH/\//-}
timeout: 360
confirm: true
secrets: [ rancher_access_key, rancher_secret_key ]
when:
status: success
branch: [hotfix/*, feature/*, develop]
staging-beta-worker-deploy:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: workers/bot-worker
group: deploying
docker_image: nossas/bonde-bot-beta:${DRONE_BRANCH/\//-}
timeout: 360
confirm: true
secrets: [ rancher_access_key, rancher_secret_key ]
when:
status: success
branch: [hotfix/*, feature/*, develop]
staging-chatbot-webserver-deploy:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: webservers/chatbot
group: deploying
docker_image: nossas/bonde-bot-chatbot:${DRONE_BRANCH/\//-}
timeout: 360
confirm: true
secrets: [ rancher_access_key, rancher_secret_key ]
when:
status: success
branch: [hotfix/*, feature/*, develop]
production-build:
image: node:12-alpine
commands:
- export GRAPHQL_URL=https://api-v2.bonde.org/graphql
- yarn global add pnpm
- pnpm i
- pnpm run lint
- pnpm m run test
- pnpm m run build
when:
event: tag
production-beta-publish:
image: plugins/docker
repo: nossas/bonde-bot-beta
dockerfile: packages/beta/Dockerfile
secrets: [ docker_username, docker_password ]
username: lpirola
password: ${DOCKER_PASSWORD}
group: publishing
tags:
- ${DRONE_TAG##v}
when:
status: success
event: tag
production-chatbot-publish:
image: plugins/docker
repo: nossas/bonde-bot-chatbot
dockerfile: packages/chatbot/Dockerfile
secrets: [ docker_username, docker_password ]
username: lpirola
password: ${DOCKER_PASSWORD}
group: publishing
tags:
- ${DRONE_TAG##v}
when:
status: success
event: tag
production-beta-webservers-deploy:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: webservers/beta
docker_image: "nossas/bonde-bot-beta:${DRONE_TAG##v}"
timeout: 360
confirm: true
secrets:
- source: rancher_access_key_prod
target: rancher_access_key
- source: rancher_secret_key_prod
target: rancher_secret_key
when:
status: success
event: tag
production-beta-deploy-worker:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: workers/bot-worker
docker_image: "nossas/bonde-bot-beta:${DRONE_TAG##v}"
timeout: 360
confirm: true
secrets:
- source: rancher_access_key_prod
target: rancher_access_key
- source: rancher_secret_key_prod
target: rancher_secret_key
when:
status: success
event: tag
production-chatbot-webservers-deploy:
image: peloton/drone-rancher
url: http://cluster.bonde.org
service: webservers/chatbot
docker_image: "nossas/bonde-bot-chatbot:${DRONE_TAG##v}"
timeout: 360
confirm: true
secrets:
- source: rancher_access_key_prod
target: rancher_access_key
- source: rancher_secret_key_prod
target: rancher_secret_key
when:
status: success
event: tag
notify:
image: plugins/slack
channel: bonde_bots
username: CI - ${DRONE_REPO_NAME}
secrets: [ slack_webhook ]
when:
event: [ push, tag, build, publish, deployment, pull_request ]
status: [ success, failure ]
services:
database:
image: postgres:9.6
# commands:
# - psql -c 'create database bonde; create schema postgraphql;' -hpostgres -Upostgres
api-v2:
image: nossas/bonde-graphql
commands:
- export SCHEMA_NAME=postgraphql
- export DATABASE_URL=postgres://postgres@database/postgres
- export JWT_SECRET=create_new_token
- export JWT_TYPE=postgraphql.jwt_token
- export PG_DEFAULT_ROLE=postgres