-
Notifications
You must be signed in to change notification settings - Fork 310
/
.drone.yml
190 lines (165 loc) · 3.31 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
---
kind: pipeline
name: baseimage
platform:
os: linux
arch: amd64
trigger:
branch:
- master
- develop
event:
exclude:
- pull_request
steps:
- name: Docker tag
image: busybox
commands:
- sh docker/tags.sh
when:
event:
exclude:
- pull_request
- name: Build Docker baseimage
image: plugins/docker
settings:
repo: axarev/parsr-base
context: docker/parsr-base
dockerfile: docker/parsr-base/Dockerfile
username:
from_secret: registry_user
password:
from_secret: registry_password
---
kind: pipeline
name: API
platform:
os: linux
arch: amd64
trigger:
branch:
- master
- develop
steps:
- name: Change file ownership
image: alpine:latest
commands:
- chown -R 1001:0 /drone/src
- name: Build API
image: axarev/parsr-base:${DRONE_BRANCH}
pull: always
environment:
NODE_ENV: development
commands:
- docker/parsr/build.sh
- name: Tests
image: axarev/parsr-base:${DRONE_BRANCH}
commands:
- npm run test
- name: Docker tag
image: busybox
commands:
- sh docker/tags.sh
when:
event:
exclude:
- pull_request
- name: Build Docker API image
image: plugins/docker
settings:
repo: axarev/parsr
context: .
dockerfile: docker/parsr/Dockerfile
username:
from_secret: registry_user
password:
from_secret: registry_password
build_args:
DEV_MODE: 'true'
BASEIMAGE_VERSION: ${DRONE_BRANCH}
when:
event:
exclude:
- pull_request
depends_on:
- baseimage
---
kind: pipeline
name: UI
platform:
os: linux
arch: amd64
trigger:
branch:
- master
- develop
steps:
- name: Change file ownership
image: alpine:latest
commands:
- chown -R 1001:0 /drone/src
- name: Build UI
image: registry.access.redhat.com/ubi8/nodejs-10
environment:
NODE_ENV: development
commands:
- docker/parsr-ui/build.sh
- name: Docker tag
image: busybox
commands:
- sh docker/tags.sh
when:
event:
exclude:
- pull_request
- name: Build UI Docker image
image: plugins/docker
settings:
repo: axarev/parsr-ui-localhost
context: .
dockerfile: docker/parsr-ui/Dockerfile
username:
from_secret: registry_user
password:
from_secret: registry_password
build_args:
VUE_APP_API: http://localhost:3001
when:
event:
exclude:
- pull_request
---
kind: pipeline
name: Sonarqube
platform:
os: linux
arch: amd64
trigger:
branch:
- master
event:
exclude:
- pull_request
steps:
- name: Code analysis
image: aosapps/drone-sonar-plugin
detach: false
failure: ignore
settings:
sonar_host:
from_secret: sonar_host
sonar_token:
from_secret: sonar_token
level: INFO
sources: .
exclusions: dist
usingProperties: true
- name: Slack
image: slallemand/slack-webhook:latest
environment:
SLACK_WEBHOOK:
from_secret: slack_webhook
SONAR_HOST:
from_secret: sonar_host
commands:
- SLACK_TEXT="New sonarqube report available on $SONAR_HOST/dashboard?id=parsr" /src/slack.py