Implemented status page

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 11 years ago
parent d1f63e40e8
commit 26196e94b9
  1. 2
      BuildServer/app.js
  2. 13
      BuildServer/routes/status.js
  3. 23
      BuildServer/views/status.jade

@ -40,7 +40,7 @@ app.get('/', routes.index);
app.post('/github/postreceive', routes.postreceive);
app.get('/manual', routes.manual.get);
app.post('/manual', routes.manual.post);
app.get('/status/:owner/:reponame/:branch/:rev', routes.status.image);
app.get('/status/:owner/:reponame/:branch/:rev', routes.status.page);
app.get('/status.svg', routes.status.image);
http.createServer(app).listen(app.get('port'), function(){

@ -104,4 +104,17 @@ exports.image = function(req, res) {
};
exports.page = function(req, res) {
// console.log(req);
var options = {
owner: req.params.owner,
reponame: req.params.reponame,
branchName: req.params.branch,
branch: "/refs/heads/" + req.params.branch,
rev: req.params.rev
};
loadReport(req.app, options, function (err, options) {
options.err = err;
console.log(options);
res.render('status', options);
});
};

@ -0,0 +1,23 @@
extends layout
block content
h1 Build status
p
b Owner:
| #{owner}
p
b Repository name:
| #{reponame}
p
b Branch:
| #{branch}
p
b Commit:
| #{rev}
if err
h2 Error
pre #{err}
if report
h2 Result
pre
= JSON.stringify(report, null, 4)
Loading…
Cancel
Save