README

Some documentation

Build version: 12 - v12

git-eventc

git-eventc is a small project aiming to bridge Git repositories to eventd for commit notification.
This project is only useful in a working eventd environment. Most people will need the eventd im plugin to act as an IRC commit bot.

Events

All events from git-eventc have the following common data:

scm event category

git-eventc will provide events in the scm event category: commit, commit-group, branch-creation, branch-deletion, tag-creation, tag-deletion, push.
Here is the list of common data provided by all scm events:

commit

This event correspond to a single commit.
Here is the list of provided data:

commit-group

This event correspond to a group of commit. It will be generated if a push is adding a number of commits above a specified threshold (see --help).
Here is the list of provided data:

branch-creation and branch-deletion

This event correspond to the creation/deletion of a branch.

tag-creation and tag-deletion

This event correspond to the creation/deletion of a tag.
Here is the list of additional data provided for tag-creation:

push

This event correspond to a push. It will be generated after a set of commit events, or any of other events events.
This event is useful for mirroring purpose.

bug-report event category

git-eventc will provide events in the bug-report event category: opening, closing, reopening.
Here is the list of common data provided by all bug-report events:

mr event category

git-eventc will provide events in the mr event category: opening, closing, reopening, merge.
Here is the list of common data provided by all mr events:

ci-build event category

git-eventc will provide events in the ci-build event category: success, failure, error.
Here is the list of common data provided by all ci-build events:

Example event file

(See eventd configuration for further information.)

For a commit event:

# scm-commit.event
[Event scm commit]
Actions = scm-commit;

# scm-commit.action
[Action]
Name = scm-commit
[IMAccount irc-server]
Message = ${project-group}/^B${project}^O/^C07${branch}^O: ^C03${author-name}^O * ${id}: ${message} ^C05${url}^O ^C14${files}^0
Recipients = #test;

For a commit-group event:

# scm-commit-group.event
[Event scm commit-group]
Actions = scm-commit-group;

# scm-commit-group.action
[Action]
Name = scm-commit-group
[IMAccount irc-server]
Message = ${project-group}/^B${project}^O/^C07${branch}^O: ^C03${pusher-name}^O pushed ${size} commits ^C05${url}^O
Recipients = #test;

For a branch-creation event:

# scm-branch-creation.event
[Event scm branch-creation]
Actions = scm-branch-creation;

# scm-branch-creation.action
[Action]
Name = scm-branch-creation
[IMAccount irc-server]
Message = ${project-group}/^B${project}^O/^C07${branch}^O: ^C03${pusher-name}^O branch created ^C05${url}^O
Recipients = #test;

For a branch-deletion event:

# scm-branch-deletion.event
[Event scm branch-deletion]
Actions = scm-branch-deletion;

# scm-branch-deletion.action
[Action]
Name = scm-branch-deletion
[IMAccount irc-server]
Message = ${project-group}/^B${project}^O/^C07${branch}^O: ^C03${pusher-name}^O branch deleted ^C05${url}^O
Recipients = #test;

Executables

You can specify configuration either directly on the command-line, or in a file ~/.config/git-eventc.conf, in the key=value format. All keys must be in a [git-eventc] section and use the same name as their command-line argument.

git-eventc-post-receive

git-eventc-post-receive is a Git post-receive hook. See --help output for basic configuration.
You can use it directly as a post-receive hook or in a wrapper script. Please make sure stdin is fed correctly.

It will use configuration directly from Git. You should configure most of them in your system configuration (/etc/gitconfig).
Configuration value names are prefixed by git-eventc.. Here is the list of used values:

It also has support for Gitolite environment variables:

git-eventc-webhook

git-eventc-webhook is a tiny daemon that will listen HTTP POST based hook. These are provided by many Git host providers.
See --help output for its configuration.

Just run it or your server and point the WebHook to it. You can use the proxy support of your favorite web server if you prefer.
Direct TLS/SSL support is avaible.

git-eventc-webhook will split the URL path in two:

git-eventc-webhook will use the some parts of the query string:

Here is the list of supported services.

Example URLs:

http://example.com:8080/TestProjectGroup
https://example.com:8080/TestProjectGroup/TestProject
https://example.com/webhook/TestProjectGroup/TestProject (behind Apache ProxyPass)
https://example.com/webhook/TestProjectGroup/TestProject?data\[mirror\]=false

Secrets

git-eventc-webhook has secret support. In your GitHub WebHook configuration, you can specify a secret. This secret will be used to compute a signature of the hook payload, which is sent in the request header. git-eventc-webhook will compute the signature and compare it with the one in the request.

To specify secrets, you must use a configuration file. Here is the format:

Example:

[webhook-secrets]
Group1=secret
Group2=secret
Group3=other-secret