forked from GSI/bn-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
328 lines (309 loc) · 11.2 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
---
env: &env
CARGO_INCREMENTAL: "0"
CARGO_HOME: "/drone/src/target/tmp/cargo"
RUST_BACKTRACE: "1"
API_PORT: "8088"
API_BASE_URL: "http://localhost:8088"
CUSTOMER_IO_BASE_URL: ""
CUSTOMER_IO_API_KEY: ""
CUSTOMER_IO_SITE_ID: ""
CUBE_JS_SECRET: ""
EMAIL_ONLY_REGISTRATION_ALLOWED: true
EMAIL_TEMPLATES_TICKET_COUNT_REPORT: "CustomerIo:not-a-real-value"
EMAIL_TEMPLATES_CUSTOM_BROADCAST: "CustomerIo:not-a-real-value"
EMAIL_TEMPLATES_ORG_INVITE: "Sendgrid:d-19ea07c6169e4fe887b6527ef16cb1ea"
EMAIL_TEMPLATES_PASSWORD_RESET: "Sendgrid:d-193ea5665fc54c8ca19c6325c8e46703"
EMAIL_TEMPLATES_RESEND_DOWNLOAD_LINK: "CustomerIo:TEMPLATE_ID"
EMAIL_TEMPLATES_USER_REGISTERED_MAGIC_LINK: "CustomerIo:TEMPLATE_ID"
# Globee will not allow a localhost url
FRONT_END_URL: "https://ci-test.notreal.bigneon.com"
BUILD_DIR: "api"
TARI_URL: "TEST"
COMMUNICATION_DEFAULT_SOURCE_EMAIL: "[email protected]"
COMMUNICATION_DEFAULT_SOURCE_PHONE: "0112223333"
TOKEN_SECRET: travis_secret
TOKEN_ISSUER: bg-on-travis
STRIPE_SECRET_KEY: "sk_test_uIJ9qxcHSQmODoepmzXS3U6A00fRLldV6h"
SENDGRID_API_KEY: " "
SENDGRID_TEMPLATE_BN_REFUND: "d-9ba23272db854578a5609e4e4c608f9f"
SENDGRID_TEMPLATE_BN_USER_REGISTERED: "d-9ba23272db854578a5609e4e4c608f9f"
SENDGRID_TEMPLATE_BN_PURCHASE_COMPLETED: "d-c23ba549dd0749bbb3b244b758c05dd7"
SENDGRID_TEMPLATE_BN_TRANSFER_TICKETS: "d-f6a449f0281e404899eb4d580bc342a3"
SENDGRID_TEMPLATE_BN_USER_INVITE: "d-fcf7791b781644a8960820058c9074fd"
SENDGRID_TEMPLATE_BN_CANCEL_TRANSFER_TICKETS: "d-665486b23965415b92f63c6ed532d93f"
SENDGRID_TEMPLATE_BN_CANCEL_TRANSFER_TICKETS_RECEIPT: "d-5328ce5ed3ee432aac5a89ccd17340b5"
SENDGRID_TEMPLATE_BN_TRANSFER_TICKETS_DRIP: "d-7209c990c99945ea88738dddf3463eb1"
SENDGRID_TEMPLATE_BN_TRANSFER_TICKETS_DRIP_DESTINATION: "d-7209c990c99945ea88738dddf3463eb1"
SENDGRID_TEMPLATE_BN_TRANSFER_TICKETS_DRIP_SOURCE: "d-1ad9cf474ee945f1a00f3534f41b6f8b"
SENDGRID_TEMPLATE_BN_TRANSFER_TICKETS_RECEIPT: "d-3b5d9abc10ea41449b045eca7d1e31df"
SENDGRID_TEMPLATE_BN_EVENT_UPCOMING_DRIP: "d-3b5d9abc10ea41449b045eca7d1e31df"
SENDGRID_TEMPLATE_BN_EVENT_POST_PROMO_DRIP: "d-3b5d9abc10ea41449b045eca7d1e31df"
SHARETRIBE_CLIENT_ID: "d6c14940-e4cc-48c1-b8a3-afadc6c9f36f"
SHARETRIBE_CLIENT_SECRET:
from_secret: SHARETRIBE_CLIENT_SECRET
HTTP_KEEP_ALIVE: 75
BLOCK_EXTERNAL_COMMS: 1
TWILIO_ACCOUNT_ID: " "
TWILIO_API_KEY: " "
API_KEYS_ENCRYPTION_KEY: "test_key"
GLOBEE_API_KEY: "GDFOzMkPAw79a8TCAHKkiknJB6bEYgbb"
GLOBEE_BASE_URL: "https://test.globee.com/payment-api/v1/"
VALIDATE_IPNS: false
CONNECTION_POOL_MAX: 20
CONNECTION_POOL_MIN: 1
BRANCH_IO_BRANCH_KEY:
from_secret: BRANCH_IO_BRANCH_KEY
PRODUCT_CONTEXT: BigNeon
kind: pipeline
name: Build
steps:
# This check is done on another build for event:push
- name: rust-fmt-check
depends_on:
- clone
image: rust:1.42
commands:
- rustup component add rustfmt
- cargo fmt --all -- --check
#
# - name: restore-cache
# depends_on:
# - clone
# image: plugins/s3-cache
# settings:
# restore: true
# endpoint: http://minio1:9000
# access_key:
# from_secret: minio_access_key_id
# secret_key:
# from_secret: minio_secret_access_key
# mount:
# - ./target
# fallback_path:
# from_secret: cache_fallback_path
# root: drone
# when:
# event: [pull_request, push]
# branch: master
- name: compile
depends_on:
- clone
image: rust:1.42
environment:
<<: *env
GH_USER_EMAIL: '[email protected]'
GH_USER_NAME: 'Travis CI'
GITHUB_SSH_KEY:
from_secret: github_deploy_key
GITHUB_RELEASE_SSH_KEY:
from_secret: github_release_ssh_key
commands:
- cargo build --release --bins
- test -x target/release/server
- test -x target/release/bndb_cli
- test -x target/release/api-cli
when:
event: [pull_request, push]
branch: [master, develop]
- name: store-executable
depends_on:
- compile
image: sdbondi/git-ssh-client:0.2-alpine
environment:
<<: *env
GH_USER_EMAIL: '[email protected]'
GH_USER_NAME: 'Travis CI'
GITHUB_RELEASE_SSH_KEY:
from_secret: github_release_ssh_key
commands:
- ./scripts/push-feature-binary.sh
when:
event: [pull_request, push]
branch: [master, develop]
# - name: rebuild-cache
# depends_on:
# - compile
# image: plugins/s3-cache
# settings:
# rebuild: true
# endpoint: http://minio1:9000
# access_key:
# from_secret: minio_access_key_id
# secret_key:
# from_secret: minio_secret_access_key
# mount:
# - ./target
# root: drone
# when:
# event: [pull_request, push]
# branch: master
# - name: cargo-audit
# depends_on:
# - compile
# image: rust:1.31.1
# commands:
# - ./scripts/run-cargo-audit.sh
# when:
# event: [pull_request, push]
# branch: master
- name: other-tests
depends_on:
- compile
image: rust:1.42
environment:
<<: *env
DATABASE_URL: postgres://app:password@database/other_tests
READONLY_DATABASE_URL: postgres://app:password@database/other_tests
TEST_DATABASE_URL: postgres://app:password@database/other_tests
TEST_READONLY_DATABASE_URL: postgres://app:password@database/other_tests
TEST_DATABASE_ADMIN_URL: postgres://app:password@database/other_tests
commands:
- ./scripts/run-other-tests-ci.sh
when:
event: [pull_request, push]
branch: [master, develop]
# - name: api-tests
# depends_on:
# - compile
# image: rust:1.31.1
# environment:
# <<: *env
# DATABASE_URL: postgres://app:password@database/api_tests
# TEST_DATABASE_URL: postgres://app:password@database/api_tests
# TEST_DATABASE_ADMIN_URL: postgres://app:password@database/api_tests
# commands:
# - ./scripts/run-api-tests-ci.sh
# when:
# event: [pull_request, push]
# branch: master
- name: integration-tests
depends_on:
- compile
image: sdbondi/rust-node:0.1
environment:
<<: *env
DATABASE_URL: postgres://app:password@database/integration_tests
READONLY_DATABASE_URL: postgres://app:password@database/integration_tests
TEST_DATABASE_URL: postgres://app:password@database/integration_tests
TEST_READONLY_DATABASE_URL: postgres://app:password@database/integration_tests
TEST_DATABASE_ADMIN_URL: postgres://app:password@database/integration_tests
RUST_LOG: error
commands:
- ./scripts/run-integration-tests-ci.sh
when:
event: [pull_request, push]
branch: [master, develop]
# - name: publish
# image: plugins/ecr
# depends_on:
## - cargo-audit
# - api-tests
# - integration-tests
# - other-tests
# settings:
# dockerfile: Dockerfile.drone
# tags:
# - latest
# - 0.2.${DRONE_BUILD_NUMBER}
# region:
# from_secret: aws_region
# repo:
# from_secret: docker_repo
# access_key:
# from_secret: aws_access_key_id
# secret_key:
# from_secret: aws_secret_access_key
# when:
# branch: master
# event: push
- name: bump-version
depends_on:
# - publish
# - cargo-audit
# - api-tests
- integration-tests
- other-tests
image: sdbondi/git-ssh-client:0.2-alpine
environment:
<<: *env
GH_USER_EMAIL: '[email protected]'
GH_USER_NAME: 'Travis CI'
GITHUB_SSH_KEY:
from_secret: github_deploy_key
commands:
- ./scripts/bump-version.sh --tag-commit
when:
event: push
branch: [master, develop]
# - name: deploy-dev
# image: sdbondi/drone-lambda-trigger
# depends_on:
# - publish
# environment: *env
# settings:
# access_key_id:
# from_secret: aws_access_key_id
# aws_region:
# from_secret: aws_region
# secret_access_key:
# from_secret: aws_secret_access_key
# function_name:
# from_secret: deploy_lambda_function_name
# payload: |-
# {\\"targetName\\": \\"bn-api-staging\\", \\"tag\\": \\"$APP_VERSION\\"}
# when:
# branch: master
# event: push
- name: flush-cache
depends_on:
# - deploy-dev
- bump-version
image: plugins/s3-cache
settings:
flush: true
flush_age: 30
endpoint: http://minio1:9000
access_key:
from_secret: minio_access_key_id
secret_key:
from_secret: minio_secret_access_key
mount:
- ./target
root: drone
when:
event: [pull_request, push]
branch: [master, develop]
- name: notify
image: plugins/slack
depends_on:
- other-tests
# - api-tests
- integration-tests
settings:
webhook:
from_secret: nomatter_webhook
username: drone
icon_emoji: drone
channel: tari-natterbot
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, develop]
---
kind: signature
hmac: f2113b7a565a42fc1a6a967b7568b36419422ddb1bfd2e3b882cdce1d6d60c0c
...