Code Monkey home page Code Monkey logo

git-hipchat-hook's Introduction

Git HipChat Hook

A simple GIT post-receive hook script for notifying a room in HipChat.

Installation

Clone this repository somewhere in your GIT repository host server. For example:

cd /home/git
git clone git://github.com/eirc/git-hipchat-hook.git

Clone hipchat-cli somewhere in your GIT repository host server.

git clone git://github.com/hipchat/hipchat-cli.git

Go to the hooks directory in a bare repository you want to setup the hooks for and add a post-receive script like this one and make sure its executable.

You can lookup the HipChat room id from the rooms/list API or use the HipChat room name (remember to urlencode it)

#!/bin/sh

HIPCHAT_SCRIPT="/path/to/hipchat_room_message"
HIPCHAT_ROOM="HipChat room name or room_id"
HIPCHAT_TOKEN="1234567890"
HIPCHAT_FROM="GIT"

. /path/to/hipchat-post-receive

If using gitorious make sure to add GIT_PROJECT="Name of project" to the hook:

#!/bin/sh

HIPCHAT_SCRIPT="/path/to/hipchat_room_message"
HIPCHAT_ROOM="HipChat room name or room_id"
HIPCHAT_TOKEN="1234567890"
HIPCHAT_FROM="GIT"
GIT_PROJECT="MyScripts"

. /path/to/hipchat-post-receive

And you're done!

For GitWeb, CGit, Gitorious and Redmine integrations (optional) add the following configuration to the post-receive hook before the hipchat-post-receive source line.

Note that CGit and GitWeb, and Redmine and JIRA, are mutually exclusive.

CGIT="git.example.com/cgit"
GITWEB="gitweb.example.com"
JIRA="jira.example.com"
REDMINE="redmine.example.com"
GITORIOUS="gitorious.example.com"

Contributions

  • graffic for the sed RegEx to link to Redmine issues.
  • jparise for CGit and JIRA integrations.

git-hipchat-hook's People

Contributors

eirc avatar jdanbrown avatar jparise avatar julianz avatar mehryar avatar sterutkb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-hipchat-hook's Issues

"-e" showing up in message

I installed the hook and hipchat-cli. Now when I push, I see this (which I'm unsure whether is related to the problem):

...
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 449 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
remote: [: 13: 5a791478013b788df562c6bd5838775a1111136c: unexpected operator
remote: [: 62: 975b2c77036b4491c7e594e0a32ebffc6bd6fc0d: unexpected operator
remote: [: 62: 5a791478013b788df562c6bd5838775a1111136c: unexpected operator
...

The push succeeds, yet in my Hipchat window, I see a "-e" in front of each line in the message, like this:

-e Matt Sawyer pushed to branch master of samplerepo.git
-e - testing git-hipchat integration (975b2c7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.