forked from OpenBAS-Platform/openbas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
176 lines (166 loc) · 4.67 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
---
kind: pipeline
name: openbas-tests
steps:
- name: api-tests
image: maven:3.9.9-eclipse-temurin-22
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql:5432/openbas
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
commands:
- mvn clean install -q -DskipTests
- cd openbas-api
- mvn test -q
- cd ../openbas-framework
- mvn test -q
- name: frontend-tests
image: node:20-alpine
volumes:
- name: cache-node-frontend
path: /drone/src/openbas-front/node_modules
commands:
- cd openbas-front
- yarn install
- yarn build
- yarn check-ts
- yarn lint
- yarn i18n-checker
- NODE_OPTIONS=--max_old_space_size=8192 yarn test
- name: app-e2e
image: maven:3.9.9-eclipse-temurin-22
detach: true
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql-e2e:5432/openbas
SPRING_DATASOURCE_USERNAME: openbas
SPRING_DATASOURCE_PASSWORD: openbas
MINIO_ENDPOINT: minio-e2e
MINIO_PORT: 9000
MINIO_ACCESS_KEY: minioadmin
MINIO_ACCESS_SECRET: minioadmin
OPENBAS_ADMIN_EMAIL: [email protected]
OPENBAS_ADMIN_PASSWORD: admin
OPENBAS_ADMIN_TOKEN: 0d17ce9a-f3a8-4c6d-9721-c98dc3dc023f
commands:
- apt update && apt install -y gnupg
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
- apt update
- apt install -y yarn
- apt install -y nodejs
- apt install -y git
- cd openbas-front
- yarn install
- yarn build
- cd ..
- mvn install -DskipTests=true
- java -jar openbas-api/target/openbas-api.jar
depends_on:
- api-tests
- frontend-tests
- name: frontend-e2e-tests
image: node:20.17.0
volumes:
- name: cache-node-frontend-e2e
path: /drone/src/openbas-front/node_modules
commands:
- apt update
- apt -y install netcat-traditional
- while ! nc -z app-e2e 8080 ; do sleep 1 ; done
- cd openbas-front
- yarn install
- yarn playwright install --with-deps chromium
- APP_URL=http://app-e2e:8080 yarn test:e2e
depends_on:
- app-e2e
- name: codecov
image: robertstettner/drone-codecov
settings:
token:
from_secret: codecov_token
files:
- openbas-api/target/site/jacoco/jacoco.xml
- openbas-framework/target/site/jacoco/jacoco.xml
depends_on:
- api-tests
- name: build-circleci
image: curlimages/curl
commands:
- curl -X POST --data "branch=master" https://circleci.com/api/v1.1/project/github/OpenBAS-Platform/openbas/build?circle-token=$CIRCLECI_TOKEN
environment:
CIRCLECI_TOKEN:
from_secret: circleci_token
when:
branch:
- master
event:
exclude:
- pull_request
- tag
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests
- name: build-circleci-release
image: curlimages/curl
commands:
- curl -X POST --data "tag=$DRONE_TAG" https://circleci.com/api/v1.1/project/github/OpenBAS-Platform/openbas/build?circle-token=$CIRCLECI_TOKEN
environment:
CIRCLECI_TOKEN:
from_secret: circleci_token
when:
event:
- tag
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
username: drone
channel: notifications
when:
status: [ success, failure ]
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests
services:
- name: minio
image: minio/minio:RELEASE.2023-12-02T10-51-33Z-cpuv1
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: [ server, /data ]
- name: pgsql
image: postgres:16-alpine
environment:
POSTGRES_USER: openbas
POSTGRES_PASSWORD: openbas
POSTGRES_DB: openbas
- name: minio-e2e
image: minio/minio:RELEASE.2023-12-02T10-51-33Z-cpuv1
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: [ server, /data ]
- name: pgsql-e2e
image: postgres:16-alpine
environment:
POSTGRES_USER: openbas
POSTGRES_PASSWORD: openbas
POSTGRES_DB: openbas
volumes:
- name: cache-node-frontend
host:
path: /tmp/cache-node-frontend
- name: cache-node-frontend-e2e
host:
path: /tmp/cache-node-frontend-e2e
- name: cache-python
host:
path: /tmp/cache-python