forked from OpenBAS-Platform/openbas
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
153 lines (146 loc) · 3.64 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
kind: pipeline
type: docker
name: openex-tests-pull-request
concurrency: {
limit: 2
}
trigger:
event:
- pull_request
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: api-tests
image: maven:3.9.6-eclipse-temurin-21
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql:5432/openex
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
commands:
- mvn install -DskipTests
- cd openex-api
- mvn test
- cd ../openex-framework
- mvn test
- cd ../openex-injectors
- mvn test
depends_on:
- submodules
- name: frontend-tests
image: node:20.11.0-alpine3.18
commands:
- cd openex-front
- yarn install
- yarn build
- yarn check-ts
- yarn lint
- yarn i18n-checker
- NODE_OPTIONS=--max_old_space_size=8192 yarn test
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: openex
POSTGRES_PASSWORD: openex
POSTGRES_DB: openex
---
kind: pipeline
type: docker
name: openex-tests-master
trigger:
branch:
- master
event:
exclude:
- pull_request
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: api-tests
image: maven:3.9.6-eclipse-temurin-21
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql:5432/openex
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
commands:
- mvn install -DskipTests
- cd openex-api
- mvn test
- cd ../openex-framework
- mvn test
- cd ../openex-injectors
- mvn test
depends_on:
- submodules
- name: frontend-tests
image: node:20.11.0-alpine3.18
commands:
- cd openex-front
- yarn install
- yarn build
- yarn check-ts
- yarn lint
- yarn i18n-checker
- NODE_OPTIONS=--max_old_space_size=8192 yarn test
- name: codecov
image: robertstettner/drone-codecov
settings:
token:
from_secret: CODECOV_TOKEN
files:
- openex-api/target/site/jacoco/jacoco.xml
- openex-framework/target/site/jacoco/jacoco.xml
- openex-injectors/openex-caldera/target/site/jacoco/jacoco.xml
- name: build-circleci
image: curlimages/curl
commands:
- curl -X POST --data "branch=master" https://circleci.com/api/v1.1/project/github/OpenEx-Platform/openex/build?circle-token=$CIRCLECI_TOKEN
environment:
CIRCLECI_TOKEN:
from_secret: circleci_token
when:
event:
exclude:
- tag
- name: build-circleci-release
image: curlimages/curl
commands:
- curl -X POST --data "tag=$DRONE_TAG" https://circleci.com/api/v1.1/project/github/OpenEx-Platform/openex/build?circle-token=$CIRCLECI_TOKEN
environment:
CIRCLECI_TOKEN:
from_secret: circleci_token
when:
event:
- tag
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
username: drone
channel: notifications
when:
status: [ success, failure ]
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: openex
POSTGRES_PASSWORD: openex
POSTGRES_DB: openex