forked from TheHive-Project/Cortex-Analyzers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
159 lines (141 loc) · 4.4 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
---
kind: pipeline
type: docker
name: default
# Build and publish docker images for analyzers
steps:
- name: build analyzers for release
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: analyzers
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
stable: true
when:
event: [tag]
- name: build analyzers for snapshot
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: analyzers
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
when:
branch: [develop]
# Build and publish docker images for responders
- name: build responders for release
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: responders
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
stable: true
when:
event: [tag]
- name: build responders for snapshot
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: responders
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
when:
branch: [develop]
# Build and publish catalogs for docker images
- name: build stable catalogs
image: thehiveproject/neurons-build-catalogs
when:
event: [tag]
- name: build report-templates zip package
image: thehiveproject/neurons-build-report-templates
when:
event: [tag]
- name: upload catalogs and report-templates package to package server
image: appleboy/drone-scp
settings:
host: {from_secret: package_host}
username: {from_secret: package_user}
key: {from_secret: package_key}
target: {from_secret: catalog_path}
source:
- analyzers/analyzers.json
- analyzers/analyzers-stable.json
- responders/responders.json
- responders/responders-stable.json
strip_components: 1
when:
event: [tag]
- name: build devel catalogs
image: thehiveproject/neurons-build-catalogs
when:
branch: [develop]
- name: upload devel catalogs to package server
image: appleboy/drone-scp
settings:
host: {from_secret: package_host}
username: {from_secret: package_user}
key: {from_secret: package_key}
target: {from_secret: catalog_path}
source:
- analyzers/analyzers-devel.json
- responders/responders-devel.json
strip_components: 1
when:
branch: [develop]
# Build and publish Documentation
- name: Prepare documentation files
image: thehiveproject/doc-builder
settings:
type: Cortex-Neurons
when:
event: [tag]
- name: Publish documentation
image: thehiveproject/mkdocs
settings:
token: {from_secret: github_token}
when:
event: [tag]
- name: rebuild all analyzers periodically
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: analyzers
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
stable: true
force: true
when:
event: [cron]
- name: rebuild all responders periodically
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: responders
namespace: cortexneurons
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
stable: true
force: true
when:
event: [cron]
- name: send message
image: thehiveproject/drone_keybase
settings:
username: {from_secret: keybase_username}
paperkey: {from_secret: keybase_paperkey}
channel: {from_secret: keybase_channel}
commands:
- |
keybase oneshot -u "$PLUGIN_USERNAME" --paperkey "$PLUGIN_PAPERKEY"
URL="$DRONE_SYSTEM_PROTO://$DRONE_SYSTEM_HOST/$DRONE_REPO/$DRONE_BUILD_NUMBER"
if [ $DRONE_BUILD_STATUS = "success" ]
then
keybase chat send "$PLUGIN_CHANNEL" ":white_check_mark: $DRONE_REPO: build succeeded $URL"
else
keybase chat send "$PLUGIN_CHANNEL" ":x: $DRONE_REPO: build failed $URL"
fi
when:
status:
- success
- failure