2.0.0 • Published 2 years ago

keptn-send-event v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

keptn-send-event

Standard - JavaScript Style Guide

NPM

Send event to Keptn in Kubernetes cluster.

Example

import { send } from "keptn-send-event";

// If you select this section will use port-forwarding and Keptn API token will get from K8s secrets
const kubeSettings = `{
  "enabled": true,
  "namespace": "keptn",
  "secret": "keptn-api-token",
  "service": "api-gateway-nginx"
}`;

// If you have public Keptn URL and `enabled = false` please fill these settings
const keptnAuth = `{
  "keptnURL": "",
  "token": ""
}`;

const event = `{
  "data": {
    "project": "test",
    "stage": "develop",
    "service": "k6",
    "message": "",
    "status": "",
    "result": ""
  },
  "source": "gh",
  "specversion": "1.0",
  "type": "sh.keptn.event.develop.performance.triggered",
  "shkeptnspecversion": "0.2.3"
}`;

const keptnContext = send(event, keptnAuth, kubeSettings);