Drone plugin for Chronosphere Change Events
Drone plugin for Harness pipelines to publish Chronosphere Change Events.
Usage
On host
Setup:
- golang installed (
1.22.3
)
GOBIN
environment variable configured where go binaries will be installed
GOBIN
on your PATH
so installed go binaries are discovered
Install:
go install
Usage help:
drone-plugin-chronosphere-change-events --help
drone-plugin-chronosphere-change-events publish--help
Publishing a deploy event:
drone-plugin-chronosphere-change-events publish --category deploys --event_type deploy_test --source local --labels 'environment=local;cluster=none'
Troubleshooting with --dry-run
(skips API call) and --debug
(outputs diagnostics to the console):
drone-plugin-chronosphere-change-events --dry-run --debug publish --category deploys --event_type deploy_test --source local --labels 'environment=local;cluster=none'
In Docker container
To build the distroless image (~4MB):
make build
Usage:
docker run --rm burkestar/drone-plugin-chronosphere-change-events:latest --help
Note that publish
is the default command used when running the container.
Publish event:
docker run --rm \
-e PLUGIN_CHRONOSPHERE_EVENTS_API="${CHRONOSPHERE_EVENTS_API}" \
-e PLUGIN_CHRONOSPHERE_API_TOKEN="${CHRONOSPHERE_API_TOKEN}" \
-e PLUGIN_CATEGORY=deploys \
-e PLUGIN_EVENT_TYPE=deploy_test \
-e PLUGIN_SOURCE=local \
-e PLUGIN_LABELS="environment=local;cluster=none" \
burkestar/drone-plugin-chronosphere-change-events:latest
As Drone plugin
steps:
- name: chronosphere-change-event
image: burkestar/drone-plugin-chronosphere-change-events
settings:
chronosphere_events_api: https://COMPANY.chronosphere.io/api/v1/data/events
chronosphere_api_token: SOMETHING_SECRET
category: deploys
event_type: deploy_test
source: drone
labels: "environment=dev;cluster=dev-cluster"
As plugin in Harness pipeline
Assumptions:
- Harness is configured with a connector to Docker registry (
account.harnessImage
)
- Harness is configured with org-level variable
chronosphere_events_api
- Harness is configured with org-level secret
chronosphere_api_token
Within your pipeline YAML:
steps:
- step:
type: Plugin
name: chronosphere change event
identifier: chronosphere_change_event
spec:
connectorRef: account.harnessImage ## Docker connector to pull the plugin's Docker image
image: burkestar/drone-plugin-chronosphere-change-events
settings:
chronosphere_events_api: <+variable.org.chronosphere_events_api>
chronosphere_api_token: <+secrets.getValue("org.chronosphere_api_token")>
category: deploys
event_type: deploy_test
source: drone
labels: "environment=dev;cluster=dev-cluster"
Development
Publish image to Docker Hub:
make publish