Russtopia edited this page 1 year ago

bacillμs Wiki

This wiki is a launching point for miscellaneous information about the program. While it's designed to be as simple as possible, points about the implementation or typical usage might merit further detail here.

Release Notes

Using Hooks (v0.2.2+)

bacillμs supports two types of hooks: raw git hooks (post-receive) and JSON webhooks ala github etc.

Raw git hooks

In a git repo, the hooks/ dir can contain a post-receive script, which is triggered just after the push completes. It receives three parameters via stdin, {old SP new SP ref} (SP = space); see https://git-scm.com/docs/githooks#pre-receive. The new and ref parameters are passed to bacillμs jobs as env vars $BACILLUS_COMMITID and $BACILLUS_REF respectively.


Webhooks are defined in one's git web repo application; the gogs.io webhook documentation states that this conforms to the JSON defined here https://gogs.io/docs/features/webhook and should be github- and gogs-compatible. Like the raw git hook, JSON fields commits[0].id and ref from this JSON will be passed to bacillμs jobs as env vars $BACILLUS_COMMITID and $BACILLUS_REF respectively.

(NOTE: currently if both a raw git hook and a webhook are defined, the webhook JSON will take precedence and the git hook will still execute on refs/heads/master, regardless of what branch actually received a commit. Future versions will more intelligently decide which event to use.)