在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:substack/pushover开源软件地址:https://github.com/substack/pushover开源编程语言:JavaScript 100.0%开源软件介绍:pushoverServe up git repositories over http and accept git pushes. This library makes it super easy to set up custom git push deploy logic. examplevar pushover = require('pushover');
var repos = pushover('/tmp/repos');
repos.on('push', function (push) {
console.log('push ' + push.repo + '/' + push.commit
+ ' (' + push.branch + ')'
);
push.accept();
});
repos.on('fetch', function (fetch) {
console.log('fetch ' + fetch.commit);
fetch.accept();
});
var http = require('http');
var server = http.createServer(function (req, res) {
repos.handle(req, res);
});
server.listen(7000); then start up the pushover server...
meanwhile...
and then...
or...
and then...
methodsvar pushover = require('pushover') var repos = pushover(repoDir, opts={autoCreate:true})Create a new repository collection from the directory If The return value, By default, repository targets will be created if they don't exist. You can
disable that behavior with If repos.handle(req, res)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.create(repoName, cb)Create a new bare repository Optionally get a callback repos.mkdir(dir, cb)Create a subdirectory repos.list(cb)Get a list of all the repositories in the callback repos.exists(repoName, cb)Find out whether eventsrepos.on('push', function (push) { ... }Emitted when somebody does a Exactly one listener must call
repos.on('tag', function (tag) { ... }Emitted when somebody does a Exactly one listener must call
repos.on('fetch', function (fetch) { ... }Emitted when somebody does a Exactly one listener must call
repos.on('info', function (info) { ... }Emitted when the repo is queried for info before doing other commands. Exactly one listener must call
repos.on('head', function (head) { ... }Emitted when the repo is queried for HEAD before doing other commands. Exactly one listener must call
push.on('response', function(response, done) { ... })Emitted when pushover creates a resposne stream that will be sent to the git client on the other end. This should really only be used if you want to send verbose or error messages to the remote git client.
If you create a response listener then you must either call the response.queue(new Buffer('0000'))
response.queue(null) If you never use the response event then the above data will be sent by default. Binding a listener to the response event will prevent the end sequence those from being sent, so you must send them yourself after sending any other messages. http duplex objectsThe arguments to each of the events For every event if there are no listeners dup.accept()Accept the pending request. dup.reject()Reject the pending request. installWith npm do:
licenseMIT kudosReading through grack was super handy. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论