Hermes - Codefresh Trigger Manager
Codefresh Trigger Manager (aka hermes
) is responsible for processing normalized events coming from different Event Providers and triggering Codefresh pipeline execution using variables extracted from events payload.
Normalized Event
It's responsibility of Event Provider to get interesting events (or generate; cron
for example) from external system either with WebHook or using some pooling technique, extract unique event URI and normalize these events and send then to hermes
.
{
"secret": "secret (or payload signature)",
"variables": {
"key1": "value",
"key2": "value2",
"...": "...",
"keyN": "valueN"
},
"original" : "base64enc(original.payload)"
}
secret
- validation secret or hmac
signature (sha1
, sha256
, sha512
); webhook payload hmac
signature for example
variables
- list of selected event properties, extracted from event payload
original
- original event payload (JSON or FORM), base64
encoded
Trigger Manager
Hermes trigger manager is a single binary file hermes
. This file includes both configuration CLI and trigger manager server.
NAME:
hermes - configure triggers and run trigger manager server
USAGE:
Configure triggers for Codefresh pipeline execution or start trigger manager server. Process "normalized" events and run Codefresh pipelines with variables extracted from events payload.
╦ ╦┌─┐┬─┐┌┬┐┌─┐┌─┐ ╔═╗┌─┐┌┬┐┌─┐┌─┐┬─┐┌─┐┌─┐┬ ┬ ╔╦╗┬─┐┬┌─┐┌─┐┌─┐┬─┐┌─┐
╠═╣├┤ ├┬┘│││├┤ └─┐ ║ │ │ ││├┤ ├┤ ├┬┘├┤ └─┐├─┤ ║ ├┬┘││ ┬│ ┬├┤ ├┬┘└─┐
╩ ╩└─┘┴└─┴ ┴└─┘└─┘ ╚═╝└─┘─┴┘└─┘└ ┴└─└─┘└─┘┴ ┴ ╩ ┴└─┴└─┘└─┘└─┘┴└─└─┘
hermes respects following environment variables:
- STORE_HOST - set the url to the Redis store server (default localhost)
- STORE_PORT - set Redis store port (default to 6379)
- STORE_PASSWORD - set Redis store password
Copyright © Codefresh.io
VERSION:
0.6.0
git-commit: 6f88d67
build-date: 2018-01-11_14:43_GMT
platform: darwin amd64 go1.9.2
AUTHOR:
Alexei Ledenev <alexei@codefresh.io>
COMMANDS:
server start trigger manager server
trigger configure Codefresh triggers
pipeline configure Codefresh trigger pipelines
info get information about installed event providers and events
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--codefresh value, -c value Codefresh API endpoint (default: "https://g.codefresh.io/") [$CFAPI_URL]
--token value, -t value Codefresh API token [$CFAPI_TOKEN]
--redis value, -r value redis store host name (default: "localhost") [$STORE_HOST]
--redis-port value, -p value redis store port (default: 6379) [$STORE_PORT]
--redis-password value, -s value redis store password [$STORE_PASSWORD]
--config value type config file (default: "/etc/hermes/type_config.json") [$TYPES_CONFIG]
--skip-monitor, -m skip monitoring config file for changes
--log-level value, -l value set log level (debug, info, warning(*), error, fatal, panic) (default: "warning") [$LOG_LEVEL]
--dry-run, -x do not execute commands, just log
--json, -j produce log in JSON format: Logstash and Splunk friendly
--help, -h show help
--version, -v print the version
Deploy with Helm
Hermes uses Codefresh API to execute pipelines and requires to pass non-expiring API token for working installation.
When you install Hermes as a separate release (from Codefresh), you must also pass a CFAPI_URL
.
helm install hermes --set cfapi.token="GET-CFAPI-TOKEN"
Building Hermes
hermes
requires Go SDK to build.
- Clone this repository into
$GOPATH/src/github.com/codefresh-io/hermes
- Run
hack/build.sh
helper script or go build cmd/main.go
- Run
hack/test.sh
helper script to test
Debug with Telepresence
- Open Terminal and run Delve debugger with
telepresence
# Deployment: triggers-hermes, Namespace: triggers
telepresence --swap-deployment triggers-hermes --namespace triggers --method=vpn-tcp --expose=8080 --run .debug/runDelve.sh
- Attach to remote debugger with
Remote
launch configuration
Or you can run .debug/background_swap.sh
in terminal and then start debugger with Telepresence
launch configuration