Skip to content

Commit

Permalink
Add drone configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 29, 2020
1 parent 01ee9da commit fb8f5aa
Showing 1 changed file with 96 additions and 28 deletions.
124 changes: 96 additions & 28 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,30 @@ name: default

steps:
- name: build analyzers for release
image: thehiveproject/cortex-worker-builder
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: analyzers
namespace: cortexneurons
user: {from_secret: docker_username}
password: {from_secret: docker_password}
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
stable: true
when:
event: [tag]

- name: build snapshot analyzers
image: thehiveproject/cortex-worker-builder
- name: build analyzers for snapshot
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: analyzers
namespace: cortexneurons
user: {from_secret: docker_username}
password: {from_secret: docker_password}
registry_dockerhub: {from_secret: registry_dockerhub}
registry_harbor: {from_secret: registry_harbor}
when:
branch:
- develop
event: {exclude: [tag]}
branch: [develop]

# Build and publish docker images for responders

- name: build responders for release
image: thehiveproject/cortex-worker-builder
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: responders
namespace: cortexneurons
Expand All @@ -42,17 +40,15 @@ steps:
when:
event: [tag]

- name: build snapshot responders
image: thehiveproject/cortex-worker-builder
- name: build responders for snapshot
image: thehiveproject/cortex-neurons-builder
settings:
worker_path: responders
namespace: cortexneurons
user: {from_secret: docker_username}
password: {from_secret: docker_password}
when:
branch:
- develop
event: {exclude: [tag]}
branch: [develop]

# Build and publish catalogs for docker images

Expand All @@ -61,7 +57,7 @@ steps:
when:
event: [tag]

- name: upload stable catalogs to bintray
- name: upload catalogs to bintray
image: thehiveproject/drone-bintray
settings:
user: {from_secret: bintray_user}
Expand Down Expand Up @@ -95,12 +91,26 @@ steps:
when:
event: [tag]

- name: upload 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.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
branch: [develop]

- name: upload devel catalogs to bintray
image: thehiveproject/drone-bintray
Expand Down Expand Up @@ -129,23 +139,81 @@ steps:
--file responders/responders-devel.json \
--repo cortexneurons
when:
branch:
- develop
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
# Build and publish Documentation

- name: Prepare documentation files
image: thehiveproject/doc-builder
settings:
type: Cortex-Neurons
when:
branch:
- master
branch: [master]

- name: Publish documentation
- name: Publish documentation
image: thehiveproject/mkdocs
settings:
token: { from_secret: github_token }
token: {from_secret: github_token}
when:
branch: [master]

- name: rebuild all analyzers periodically
image: thehiveproject/cortex-worker-builder
settings:
worker_path: analyzers
namespace: cortexneurons
registry_dockerhub: {from_secret: docker_credentials}
registry_harbor: {from_secret: harbor_credentials}
stable: true
force: true
when:
event:
- cron

- name: rebuild all responders periodically
image: thehiveproject/cortex-worker-builder
settings:
worker_path: responders
namespace: cortexneurons
registry_dockerhub: {from_secret: docker_credentials}
registry_harbor: {from_secret: harbor_credentials}
stable: true
force: true
when:
event:
- cron

- name: send message
image: migueldo/keybase
settings:
username: {from_secret: keybase_username}
paperkey: {from_secret: pkeybase_aperkey}
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:
branch:
- master
status:
- success
- failure

0 comments on commit fb8f5aa

Please sign in to comment.