-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.drone.yml
173 lines (160 loc) · 3.28 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
---
kind: pipeline
type: docker
name: default
steps:
- name: setup
image: node:18-alpine
when:
event:
- push
commands:
- yarn install --frozen-lockfile
volumes:
- name: cache
path: /root/.cache
- name: lint
image: node:18-alpine
when:
event:
- push
branch:
exclude: [prod]
depends_on:
- setup
commands:
- yarn lint
- name: types
image: node:16-alpine
when:
event:
- push
branch:
exclude: [prod]
depends_on:
- setup
commands:
- yarn types
- name: build
image: node:18-alpine
when:
event:
- push
branch:
exclude: [prod]
depends_on:
- setup
commands:
- yarn build
- yarn build:cli
# - name: coverage
# image: node:18-alpine
# when:
# event:
# - push
# depends_on:
# - test
# commands:
# -
# environment:
# COVERALLS_REPO_TOKEN:
# from_secret: coveralls_token
# COVERALLS_SERVICE_NAME: drone
# COVERALLS_GIT_BRANCH: ${DRONE_BRANCH}
# COVERALLS_SERVICE_NUMBER: ${DRONE_BUILD_NUMBER}
- name: server
image: node:18-alpine
detach: true
when:
event:
- push
branch:
exclude: [prod]
depends_on:
- build
commands:
- yarn start
environment:
NODE_ENV: test
MONGO_URL: mongodb://mongodb:27017/vote-test
SMTP_URL: smtp://cypress:7777
FROM_MAIL: [email protected]
REDIS_URL: redis
HOST: 0.0.0.0
- name: cypress
image: cypress/base:18.15.0
when:
event:
- push
branch:
exclude: [prod]
depends_on:
- build
commands:
- ./wait-for-it.sh server:3000 -t 30
- yarn cypress run --record
environment:
BASE_URL: http://server:3000
MONGO_URL: mongodb://mongodb:27017/vote-test
NODE_ENV: test
CYPRESS_RECORD_KEY:
from_secret: cypress_record_key
volumes:
- name: cache
path: /root/.cache
- name: docker
image: plugins/docker
when:
branch:
- prod
event: push
status: success
depends_on:
- lint
- types
- cypress
- build
settings:
repo: abakus/vote
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- version-${DRONE_COMMIT_SHA:0:7}
- latest
build_args:
- RELEASE=version-${DRONE_COMMIT_SHA:0:7}
- name: Deploy
image: abakus/ansible-deploy
when:
branch:
- prod
event: push
status: success
depends_on:
- docker
settings:
playbook: /infrastructure/esas/playbooks/deploy.yml
repository:
from_secret: infra_repository
tags:
- vote
limit: esas
extra_vars: vote_version=version-${DRONE_COMMIT_SHA:0:7}
inventory: /infrastructure/inventory
vault_password:
from_secret: ansible_vault_password
private_key:
from_secret: infra_deploy_key
services:
- name: mongodb
image: mongo:4.4
- name: redis
image: redis:6.0
volumes:
- name: cache
temp: {}
---
kind: signature
hmac: 540414f008bc6a0bbfe997f74c0153eb5983f49810fb8813faaf7ac3e4725eef