@ -8,16 +8,19 @@ var builder = require('../lib/builder'),
*/
*/
varprocessPush=function(req,res,payload){
varprocessPush=function(req,res,payload){
varrepository=payload.repository;
varrepository=payload.repository,
options={
builder.build({
app:req.app,
app:req.app,
url:repository.url,
url:repository.url,
owner:repository.owner.name,
owner:repository.owner.name,
reponame:repository.name,
reponame:repository.name,
rev:payload.after,
rev:payload.after,
branch:payload.ref
branch:payload.ref
},function(err,result){
};
console.log("Got push event for "+options.owner+"/"+options.reponame+":"+options.branch);
builder.build(options,function(err,result){
console.log("Done processing request from GitHub");
console.log("Done processing request from GitHub");
console.log("Error: "+err);
console.log("Error: "+err);
//console.log("Result:");
//console.log("Result:");
@ -37,12 +40,15 @@ var processPullRequest = function (req, res, payload) {
owner:headRepo.owner.name||headRepo.owner.login,
owner:headRepo.owner.name||headRepo.owner.login,
reponame:headRepo.name,
reponame:headRepo.name,
rev:head.sha,
rev:head.sha,
branchname:head.ref,
branch:"refs/heads/"+head.ref
branch:"refs/heads/"+head.ref
},
},
baseRepo=payload.repository,
base=pullRequest.base,
baseRepo=base.repo,
baseRepoOptions={
baseRepoOptions={
owner:baseRepo.owner.name||baseRepo.owner.login,
owner:baseRepo.owner.name||baseRepo.owner.login,
reponame:baseRepo.name
reponame:baseRepo.name,
branchname:base.ref
},
},
options={
options={
app:req.app,
app:req.app,
@ -52,8 +58,10 @@ var processPullRequest = function (req, res, payload) {
baseRepoOptions:baseRepoOptions
baseRepoOptions:baseRepoOptions
};
};
console.log("Got pull request "+action+" event, from "+headRepoOptions.owner+"/"+headRepoOptions.reponame+":"+headRepoOptions.branchname+" to "+baseRepoOptions.owner+"/"+baseRepoOptions.reponame+":"+baseRepoOptions.branchname);