Events

Reference documentation for Etcha’s Events

Etcha’s event system allows for users to trigger and chain Patterns dynamically. Etcha also uses this event system to extract information from Commands.

Triggering

All Events are triggered using Command onChange values–Events are specified here by prefixing their name with etcha::

{
  "always": true,
  "change": "echo hello event handler!",
  "id": "event issuer",
  "onChange": {
    "etcha:my_event"
  }
}

Handling

Events are sent and received from sources. A Source specifies the events it can receive and send.

System Events

These are the event names Etcha already knows about and what they’re used for:

buildManifest

Firing this event during a build will add the output of the Command’s change to the JWT’s etchaBuildManifest property.

jwt

signingCommands

Firing this event during signingCommands will set the output of the Command’s change to be the entire JWT generated by build.

verifyCommands

Firing this event during verifyCommands will have Etcha use the output of the Command’s change) for the JWT Token. Etcha will also not verify the token, as it assumes the verify commands have passed.

DO NOT TRIGGER THIS EVENT IF THE TOKEN IS NOT VERIFIED

runVar_

Firing any event with this prefix during a build will add the output of the Command’s change to the JWT’s etchaRunVars property.

stdout

Firing this event will log the output of the Command’s change to stdout.

webhookBody

Firing this event during a Webhook will have Etcha use the output of the Command’s change for the webhook response.

webhookContentType

Firing this event during a Webhook will have Etcha use the output of the Command’s change for the webhook content-type header.