0.0
No commit activity in last 3 years
No release in over 3 years
This gem is for integreting a privately hosted repository with the open source Github services project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
>= 0
 Project Readme

PushHandler

PushHandler takes push information and converts it into a format that Github Services can read and distribute.

Config

  1. Download and install Github Services
  2. Start the Sinatra server by running ruby github-services.rb
  3. Install the gem gem install push-handler
  4. In .git/hooks/ directory of your repository, create a file called post-receive.
  5. Add the following text to post-receive, filling in your information:
#!/usr/bin/ruby
require 'rubygems'
require 'push_handler'

# Through STDIN git passes us: <oldrev> <newrev> <refname>
args = STDIN.readlines.first.split(/\s+/)

PushHandler.configure do |config|
  config.repo = {
    # Where to see the repository on the web
    'url' => 'http://git.example.com',

    # Repository name
    'name' => 'Suppa Time',

    # Directory on the machine where the contents of your .git folder lives
    'working_dir' => '/mnt/suppa_time.git/',

    # True if 'working_dir' is pointing to a bare repository
    'is_bare' => true,

    # Repository owner contact info
    'owner' => {
      'name' => 'Big Boss Man',
      'email' => 'bbm@example.com'
    }
  }

  # Links to objects in your repository. Put the wildcard '%s' where the reference should go.
  config.urls['commit'] = 'http://git.example.com/commits?id=%s'    # '%s' will be replaced with the commit sha
  config.urls['branch'] = 'http://git.example.com/branches?id=%s'   # '%s' will be the branch name

  # The url that the github-services server is running.
  config.services['url'] = 'http://localhost:8080'

  # This is your configuration for 3rd parties.
  config.services['data'] = {
    'hipchat' => {
      'auth_token' => '9082afake90210',
      'room' => 12345,
      'notify' => true
    }
  }
end

PushHandler.send_to_services(*args)

Note

To see the parameters that each service requires you'll have to:

  1. Go to the github-services/ directory
  2. Execute rake services:config
  3. Open config/services.json and look up the requirements