forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
97 lines (89 loc) · 2.17 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
---
kind: pipeline
name: default
steps:
- name: restore node_modules cache
image: codesandbox-cache:1
settings:
restore: true
volumes:
- name: node_modules-cache
path: /cache
when:
event:
- pull_request
- name: install packages
image: node:10.15.3-jessie
volumes:
- name: yarn-cache
path: /usr/local/share/.cache/yarn/v4
commands:
- yarn
when:
event:
- pull_request
- name: build
image: node:10.15.3-jessie
commands:
- export STAGING_BRANCH=pr$DRONE_PULL_REQUEST
- yarn build
when:
event:
- pull_request
- name: deploy
image: codesandbox-deploy:1
settings:
domain: build.csb.dev
volumes:
- name: docker_sock
path: /var/run/docker.sock
- name: deployments
path: /root/docker/deployments
when:
event:
- pull_request
- name: slack notification
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
channel: infra
template: >
{{#success build.status}}
👍 {{repo.owner}}/{{repo.name}} pull request #{{build.pull}} successfully built. Access it at https://pr{{build.pull}}.build.csb.dev/ and see the build logs <{{build.link}}|here>.
{{else}}
👎 {{repo.owner}}/{{repo.name}} pull request #{{build.pull}} building failed. See what happened <{{build.link}}|here>.
{{/success}}
when:
event:
- pull_request
status:
- success
- failure
- name: rebuild node_modules cache
image: codesandbox-cache:1
settings:
rebuild: true
volumes:
- name: node_modules-cache
path: /cache
when:
event:
- pull_request
volumes:
- name: yarn-cache
host:
path: /var/lib/docker/volumes/yarn-cache/_data
- name: node_modules-cache
host:
path: /var/lib/docker/volumes/node_modules-cache/_data
- name: docker_sock
host:
path: /var/run/docker.sock
- name: deployments
host:
path: /root/docker/deployments
---
kind: signature
hmac: bc5d7ea6acf15887e17055e6a230bca87495d5bd49b2d451aadabc548aac49c6
...