Giter Club home page Giter Club logo

pushover's Introduction

pushover

Serve up git repositories over http and accept git pushes.

This library makes it super easy to set up custom git push deploy logic.

example

simple.js

var pushover = require('pushover');
var repos = pushover(__dirname + '/repos');

repos.on('push', function (repo) {
    console.log('received a push to ' + repo);
});

repos.listen(7000);

then start up the pushover server...

$ node example/simple.js 

meanwhile...

$ git push http://localhost:7000/beep master
Counting objects: 356, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (133/133), done.
Writing objects: 100% (356/356), 46.20 KiB, done.
Total 356 (delta 210), reused 355 (delta 210)
To http://localhost:7000/beep
 * [new branch]      master -> master

and then...

$ node example/simple.js 
received a push to beep

methods

var pushover = require('pushover')

var repos = pushover(repoDir, opts={autoCreate:true})

Create a new repository collection from the directory repoDir. repoDir should be entirely empty except for git repo directories.

repos is an EventEmitter. Right now it only emits "push" events with the repo name as the only argument.

By default, repository targets will be created if they don't exist. You can disable that behavior with opts.autoCreate.

repos.handle(req, res, next)

Handle incoming HTTP requests with a connect-style middleware.

Everything is admin-party by default. Check the credentials further up the stack using basic auth or whatevs.

repos.listen(...)

Create and return a new http server using repos.handle.

Any arguments will be passed to server.listen().

repos.create(repoName, cb)

Create a new bare repository repoName in the instance repository directory.

Optionally get a callback cb(err) to be notified when the repository was created.

repos.list(cb)

Get a list of all the repositories in the callback cb(err, repos).

repos.exists(repoName, cb)

Find out whether repoName exists in the callback cb(exists).

install

With npm do:

npm install pushover

license

MIT/X11

kudos

Reading through grack was super handy.

pushover's People

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.