Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A small project aiming to bridge Git repositories to eventd for commit notification

License

NotificationsYou must be signed in to change notification settings

sardemff7/git-eventc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 eventdim plugin to act as an IRC commit bot.

Events

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

  • repository-name: The name of the repository
  • repository-url: The URL of the repository
  • repository-namespace: The namespace (Gitlab/GitHub user/group) of the repository (if set)
  • project-group: The project group name (if set)
  • project: The project name, defaults torepository-name
  • url: An URL to see the change online (not for-deletion events)
  • extra-data: An hash table of extra data, see below for details

scm event category

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

  • pusher-name: The name of the pusher
  • pusher-username: The username of the pusher (if available)
  • pusher-email: The email of the pusher (if available)
  • pusher-avatar-url: The avatar URL of the pusher (if available)
  • branch: The updated branch name (not fortag- events, and the relatedpush event)

commit

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

  • id: The commit id
  • subject: The commit subject (first line of message)
  • message: The commit message (with subject and footer tags stripped, only if not empty)
  • full-message: The full commit message (verbatim)
  • author-name: The name of the author
  • author-email: The email of the author
  • author-username: The username of the author (if available)
  • author-avatar-url: The avatar URL of the author (if available)
  • files: The list (as a string) of modified files, with some basic prefix detection
    Thepost-receive hook also detects file renames and copies if asked so.

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:

  • size: The number of commits in this push

branch-creation andbranch-deletion

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

tag-creation andtag-deletion

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

  • previous-tag: The latest tag in this tag history tree
  • If the tag is an annotated tag:
    • subject: The commit subject (first line of message)
    • message: The commit message (with subject and footer tags stripped, only if not empty)
    • full-message: The full commit message (verbatim)
    • author-name: The name of the author
    • author-email: The email of the author
    • author-username: The username of the author (if available)
    • author-avatar-url: The avatar URL of the author (if available)

push

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

issue event category

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

  • id: The id/number of the bug report
  • title: The title of the report
  • tags: A list of tags/labels associated with the bug report (if available)
  • When available:
    • author-name: The name of the author
    • author-email: The email of the author (if available)
    • author-username: The username of the author (if available)
  • With some sources:
    • user-name: The name of the user triggering the event
    • user-email: The email of the user triggering the event (if available)
    • user-username: The username of the user triggering the event (if available)

merge-request event category

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

  • id: The id/number of the MR
  • title: The title of the MR
  • branch: The branch the MR is against
  • tags: A list of tags/labels associated with the MR (if available)
  • When available:
    • author-name: The name of the author
    • author-email: The email of the author (if available)
    • author-username: The username of the author (if available)
  • With some sources:
    • user-name: The name of the user triggering the event
    • user-email: The email of the user triggering the event (if available)
    • user-username: The username of the user triggering the event (if available)

ci-build event category

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

  • id: The id/number of the build
  • branch: The branch the build is associated with
  • duration: The duration of the build
  • If the build is associated with a merge request:
    • mr-id: The id/number of the merge request
    • mr-title: The title of the merge request
    • nm-url: The URL of the merge request

Example event file

(See eventd configuration for further information.)

For acommit 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}^0Recipients = #test;

For acommit-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}^ORecipients = #test;

For abranch-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}^ORecipients = #test;

For abranch-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}^ORecipients = #test;

Executables

You can specify configuration either directly on the command-line, or in a file~/.config/git-eventc.conf, in thekey=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 surestdin 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 bygit-eventc.. Here is the list of used values:

  • project-group: used asproject-group
  • project: used asproject, defaults torepository-name
  • repository: used asrepository-name (not meaningful in system configuration)
  • Several URL template strings:all of them have the${project-group} and${repository-name} tokens.
    • repository-url: URL template for the repository:
      • Examples:http://cgit.example.com/${repository-name} orhttp://gitweb.example.com/?p=${repository-name}.git
    • branch-url: URL template for a branch, available token:
      • ${branch}: the name of the branch
      • Examples:http://cgit.example.com/${repository-name}/log/?h=${branch} orhttp://gitweb.example.com/?p=${repository-name}.git;a=shortlog;h=refs/heads/${branch}
    • commit-url: URL template for a single commit, available token:
      • ${commit}: the commit id
      • Examples:http://cgit.example.com/${repository-name}/commit/?id=${commit} orhttp://gitweb.example.com/?p=${repository-name}.git;a=commitdiff;h=${commit}
    • tag-url: URL template for a tag, available token:
      • ${tag}: the tag name
      • Examples:http://cgit.example.com/${repository-name}/tag/?id=${tag} orhttp://gitweb.example.com/?p=${repository-name}.git;a=tag;h=${tag}
    • diff-url: URL template for a diff between two commits, available tokens:
      • ${old-commit}: the old commit id
      • ${new-commit}: the new commit id
      • Examples:http://cgit.example.com/${repository-name}/diff/?id2=${old-commit}&id=${new-commit} orhttp://gitweb.example.com/?p=${repository-name}.git;a=commitdiff;hp=${old-commit};h=${new-commit}
  • extra-data: all sub-values will be added asextra-data to the event

It also has support for Gitolite environment variables:

  • GL_USER: used aspusher-name
  • GL_REPO: used asrepository-name

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:

  • first part will be used asproject-group
  • second part (may contain slashes) will be used asproject
    The second part is optional and will default torepository-name

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

  • secret: will be used for Travis CI until we get TLS signature verification
  • data[key]: all these will be added to the eventextra-data hash table

Here is the list of supported services.

  • GitHub
  • Gitlab
  • Travis CI

Example URLs:

http://example.com:8080/TestProjectGrouphttps://example.com:8080/TestProjectGroup/TestProjecthttps://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:

  • The group name is[webhook-secrets].
  • Each key is a project group name
  • Each value is the corresponding secret

Example:

[webhook-secrets]Group1=secretGroup2=secretGroup3=other-secret

About

A small project aiming to bridge Git repositories to eventd for commit notification

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp