mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 02:05:09 +00:00
show current step
This commit is contained in:
parent
45193664ab
commit
52a18c694a
@ -77,8 +77,8 @@ Distributor.prototype._runNext = function(callback) {
|
||||
);
|
||||
});
|
||||
|
||||
executor.on('currentStep', function(stepLabel) {
|
||||
self._updateBuild(build, {currentStep: stepLabel});
|
||||
executor.on('currentStep', function(stepName) {
|
||||
self._updateBuild(build, {currentStep: stepName});
|
||||
});
|
||||
|
||||
executor.on('data', function(data) {
|
||||
|
@ -35,8 +35,7 @@ Executor.prototype.run = function(params, callback) {
|
||||
self.emit('scmData', scmData);
|
||||
var funcs = project.steps.map(function(step, index) {
|
||||
return function() {
|
||||
var stepLabel = step.name || utils.prune(step.cmd, 15);
|
||||
self.emit('currentStep', stepLabel);
|
||||
self.emit('currentStep', step.name);
|
||||
self._runStep(step, this.slot());
|
||||
};
|
||||
});
|
||||
|
@ -4,7 +4,8 @@ var Steppy = require('twostep').Steppy,
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
_ = require('underscore'),
|
||||
reader = require('./reader');
|
||||
reader = require('./reader'),
|
||||
utils = require('./utils');
|
||||
|
||||
function Project(config) {
|
||||
this.config = config;
|
||||
@ -66,7 +67,8 @@ exports.loadConfig = function(dir, callback) {
|
||||
function(err, config) {
|
||||
// apply defaults
|
||||
_(config.steps).each(function(step) {
|
||||
_(step).defaults({type: 'shell'});
|
||||
if (!step.type) step.type = 'shell';
|
||||
if (!step.name) step.name = utils.prune(step.cmd, 40);
|
||||
});
|
||||
|
||||
this.pass(config);
|
||||
|
@ -8,5 +8,5 @@ exports.prune = function(str, length) {
|
||||
result += words.shift() + ' ';
|
||||
} while (words.length && result.length < length);
|
||||
|
||||
return result.replace(/ $/, result.length <= length ? '' : '...');
|
||||
return result.replace(/ $/, words.length ? '...' : '');
|
||||
};
|
||||
|
@ -29,6 +29,11 @@ mixin statusText(build)
|
||||
span
|
||||
span #
|
||||
span= build.number
|
||||
|
||||
if build.status === 'in-progress' && build.currentStep
|
||||
span (
|
||||
span= build.currentStep
|
||||
span )
|
||||
div
|
||||
if build.scm
|
||||
span.build_info
|
||||
|
Loading…
Reference in New Issue
Block a user