Giter VIP home page Giter VIP logo

git-pull-hook's Introduction

git-pull-hook

This is a Sinatra simple app that accepts POST requests from GitHub post-receive-hooks and performs a git pull origin master in the corresponding local git repository.

Work in Progress

This is just a quick and dirty hack, and it sure has security issues. I’d appreciate your feedback, please fork it and send me a pull-request in github.

Copyright and Legal Stuff

Who cares? This is under the WTFPL and it was originally coded by Alcides Fonseca

Short Guide

Well, first of all you need ssh access to a webserver where your copy of your github repo will live in.

Requirements:

  • Git (DUH!)
  • Ruby
  • gem install sinatra yaml json

Now you should ssh into the server and generate a public/private pair of keys, without pass-phrase: ssh-keygen

Now copy the content of your public key (cat .ssh/id_rsa.pub) and paste it as a new Deploy key in your github admin panel.

Now create a folder to host all your repositories. Mine is ~/git/ and save it for later. The clone your github repository.

Now you should deploy this sinatra app. Since I use dreamhost, I followed this instructions

Remember to edit repos.yml with the folder that host all your git repos, and the pair of remote: local repository names. (Probably the same.) Your remote name can be found in http://github.com/username/remote/ and your local name is the folder that contains your git repo.

Now go to Github admin panel, and add a new webhook service with the URL your sinatra app lives in.

And that’s it!

git-pull-hook's People

Contributors

alcides avatar andhapp avatar dsmith avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.