forked from dotkom/receipt-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
147 lines (136 loc) · 3.12 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
kind: pipeline
name: default
steps:
- name: setup
image: node:11
volumes:
- name: cache
path: /tmp/cache
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn
- name: build
image: node:11
group: testing
volumes:
- name: cache
path: /tmp/cache
environment:
REACT_APP_AUTH_CALLBACK:
from_secret: auth_callback
REACT_APP_AUTH_CLIENT_ID:
from_secret: auth_client_id
REACT_APP_AUTH_ENDPOINT:
from_secret: auth_endpoint
REACT_APP_SENTRY_DSN:
from_secret: sentry_dsn
REACT_APP_LAMBDA_ENDPOINT:
from_secret: lambda_endpoint
REACT_APP_LAMBDA_KEY:
from_secret: lambda_key
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn build
- name: test
image: node:11
group: testing
volumes:
- name: cache
path: /tmp/cache
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn test
- name: compile-typescript
image: node:11
group: testing
volumes:
- name: cache
path: /tmp/cache
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn run tsc
- name: lint-typescript
image: node:11
group: testing
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn lint-ts
- name: lint-prettier
image: node:11
group: testing
when:
event: [push, pull_request, tag, deployment]
commands:
- yarn lint-prettier
- name: deploy-frontend
image: plugins/s3
volumes:
- name: cache
path: /tmp/cache
secrets:
- source: aws_access_key
target: AWS_ACCESS_KEY_ID
- source: aws_secret_key
target: AWS_SECRET_ACCESS_KEY
when:
event: push
branch: master
status: success
settings:
access_key:
from_secret: aws_access_key
secret_key:
from_secret: aws_secret_key
bucket: receipt-form-prod
source: build/**/*
target: /
strip_prefix: build/
acl: public-read
region: eu-west-1
- name: publish-backend
image: plugins/docker
secrets: [docker_username, docker_password, sentry_dsn]
environment:
SENTRY_DSN:
from_secret: sentry_dsn
when:
event: push
branch: master
status: success
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: registry.online.ntnu.no/dotkom/receipt-form-backend
registry: registry.online.ntnu.no
dockerfile: Dockerfile.prod
build_args:
- SENTRY_DSN
auto_tag: true
- name: deploy-backend
image: appleboy/drone-ssh
pull: true
secrets: [ssh_key]
when:
event: push
branch: master
status: success
settings:
host: nansen.online.ntnu.no
port: 22
username: root
key:
from_secret: ssh_key
command_timeout: 600s
script:
- /srv/www/receipt-form-prod/deploy.sh
volumes:
- name: cache
host:
path: /opt/drone/cache