mirror of
https://github.com/valitydev/Cortex-Analyzers.git
synced 2024-11-06 00:55:17 +00:00
160 lines
4.4 KiB
YAML
160 lines
4.4 KiB
YAML
---
|
|
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
|