show current step

This commit is contained in:
oleg 2015-05-20 23:20:51 +03:00
parent 45193664ab
commit 52a18c694a
5 changed files with 13 additions and 7 deletions

View File

@ -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) {

View File

@ -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());
};
});

View File

@ -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);

View File

@ -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 ? '...' : '');
};

View File

@ -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