mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 04:55:08 +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) {
|
executor.on('currentStep', function(stepName) {
|
||||||
self._updateBuild(build, {currentStep: stepLabel});
|
self._updateBuild(build, {currentStep: stepName});
|
||||||
});
|
});
|
||||||
|
|
||||||
executor.on('data', function(data) {
|
executor.on('data', function(data) {
|
||||||
|
@ -35,8 +35,7 @@ Executor.prototype.run = function(params, callback) {
|
|||||||
self.emit('scmData', scmData);
|
self.emit('scmData', scmData);
|
||||||
var funcs = project.steps.map(function(step, index) {
|
var funcs = project.steps.map(function(step, index) {
|
||||||
return function() {
|
return function() {
|
||||||
var stepLabel = step.name || utils.prune(step.cmd, 15);
|
self.emit('currentStep', step.name);
|
||||||
self.emit('currentStep', stepLabel);
|
|
||||||
self._runStep(step, this.slot());
|
self._runStep(step, this.slot());
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,8 @@ var Steppy = require('twostep').Steppy,
|
|||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
_ = require('underscore'),
|
_ = require('underscore'),
|
||||||
reader = require('./reader');
|
reader = require('./reader'),
|
||||||
|
utils = require('./utils');
|
||||||
|
|
||||||
function Project(config) {
|
function Project(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
@ -66,7 +67,8 @@ exports.loadConfig = function(dir, callback) {
|
|||||||
function(err, config) {
|
function(err, config) {
|
||||||
// apply defaults
|
// apply defaults
|
||||||
_(config.steps).each(function(step) {
|
_(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);
|
this.pass(config);
|
||||||
|
@ -8,5 +8,5 @@ exports.prune = function(str, length) {
|
|||||||
result += words.shift() + ' ';
|
result += words.shift() + ' ';
|
||||||
} while (words.length && result.length < length);
|
} 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 #
|
span #
|
||||||
span= build.number
|
span= build.number
|
||||||
|
|
||||||
|
if build.status === 'in-progress' && build.currentStep
|
||||||
|
span (
|
||||||
|
span= build.currentStep
|
||||||
|
span )
|
||||||
div
|
div
|
||||||
if build.scm
|
if build.scm
|
||||||
span.build_info
|
span.build_info
|
||||||
|
Loading…
Reference in New Issue
Block a user