Skip to content

dominictristram/gitpullservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Pull Service

A very simple Ruby Web service which is triggered by a push to Github.

On being polled by Github, the service performs a git pull to get the newly pushed code.

Installation & Setup

There are two steps. The first is to install and configure the Ruby code contained in this repository. The second is to configure a Service Hook on GitHub for your project.

Ruby Code

  1. Clone this repository to somewhere that you can make available on your server. I use /var/www (and this is the default), but you can use anything you like.

  2. Edit the control.rb file and change the path from /var/www/gitpullservice/pids/sinatra to where you've installed the file.

  3. Edit gitpullservice.rb and change the path from /var/www/dominictristram.com to wherever the git directory you wish to update is.

  4. Run the service with ruby gitpullservice.rb &

  5. You may wish to put this service start in your server's startup mechanism, such as upstart or rc.local.

GitHub Service Hook

  1. Using the GitHub Web interface, navigate to the project page for your GitHub project. Select the 'Settings' tab, then select the 'Service Hooks' link on the left. You can get to this page directly with a URL like this:

https://github.com/[username]/[project]/settings/hooks

  1. Select 'WebHook URLs'. In one of the 'URL' fields, insert the URL of your server containing the Ruby code. It will appear as so:

http://example.com:625/github/push

This above example uses the default port.

About

A very simple Ruby service which is triggered by a push to Github

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages