Implemented artifacts downloading

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 11 years ago
parent 9d462f7299
commit 2f7f4432db
  1. 14
      BuildServer/routes/artifact.js
  2. 1
      BuildServer/routes/index.js
  3. 6
      BuildServer/views/status.jade

@ -0,0 +1,14 @@
"use strict";
module.exports = function(req, res) {
var options = {
owner: req.params.owner,
reponame: req.params.reponame,
branchName: req.params.branch,
branch: "/refs/heads/" + req.params.branch,
rev: req.params.rev,
file: req.params.file
};
res.sendfile(req.app.get('releasepath') + "/" + options.owner + "/" + options.reponame + "/" + options.branch + "/" + options.rev + "/" + options.file);
};

@ -10,3 +10,4 @@ exports.index = function(req, res){
exports.postreceive = require('./postreceive'); exports.postreceive = require('./postreceive');
exports.manual = require('./manual'); exports.manual = require('./manual');
exports.status = require('./status'); exports.status = require('./status');
exports.artifact = require('./artifact');

@ -17,6 +17,12 @@ block content
if err if err
h2 Error h2 Error
pre #{err} pre #{err}
if files
h2 Artifacts
ul
each file in files
li
a(href="/artifact/" + [owner, reponame, branchName, rev, file].join("/")) #{file}
if report if report
h2 Result h2 Result
pre pre

Loading…
Cancel
Save