events
![Tag](https://img.shields.io/github/tag/gerrittrigger/events.svg)
Introduction
events is the Gerrit events written in Go.
Prerequisites
Run
version=latest make build
./bin/events --config-file="$PWD"/config/config.yml --listen-port=8080
Docker
version=latest make docker
docker run -v "$PWD"/config:/tmp ghcr.io/gerrittrigger/events:latest --config-file=/tmp/config.yml --listen-port=8080
Usage
usage: events --config-file=CONFIG-FILE [<flags>]
gerrit events
Flags:
--help Show context-sensitive help (also try --help-long
and --help-man).
--version Show application version.
--config-file=CONFIG-FILE Config file (.yml)
--listen-port=8080 Listen port
--log-level="INFO" Log level (DEBUG|INFO|WARN|ERROR)
Settings
events parameters can be set in the directory config.
An example of configuration in config.yml:
apiVersion: v1
kind: events
metadata:
name: events
spec:
connect:
hostname: localhost
ssh:
keyfile: /path/to/.ssh/id_rsa
keyfilePassword: pass
port: 29418
username: user
storage:
autoclean: "@every 48h00m00s"
sqlite:
filename: /path/to/sqlite.db
watchdog:
periodSeconds: 20
timeoutSeconds: 20
- spec.connect.hostname: Gerrit host name (e.g., 12:34:56:78)
- spec.watchdog.periodSeconds: Period in seconds (0: turn off)
- spec.watchdog.timeoutSeconds: Timeout in seconds (0: turn off)
API
GET /events/ HTTP/1.0
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[
{
"eventBase64": "ZXZlbnRCYXNlNjQ=",
"eventCreatedOn": 1672214667
},
...
]
since:'TIME': Events since the 'TIME', in the format 2023-01-01[ 10:00:00].
until:'TIME': Events until the 'TIME', in the format 2023-01-01[ 11:00:00].
# Query events which happened between 2023-01-01 10:00:00 and 2023-01-01 11:00:00
curl “http://host:port/events/?q=since:2023-01-01+10:00:00+until:2023-01-01+11:00:00”
License
Project License can be found here.
Reference