mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 18:36:19 +00:00
show current build step
This commit is contained in:
parent
004b482a06
commit
94629bd27e
@ -67,6 +67,11 @@ Distributor.prototype._runNext = function(callback) {
|
||||
});
|
||||
});
|
||||
|
||||
executor.on('currentStep', function(stepName) {
|
||||
build.currentStep = stepName;
|
||||
self._updateBuild(build);
|
||||
});
|
||||
|
||||
executor.on('data', function(data) {
|
||||
self.onBuildData(build, data);
|
||||
});
|
||||
@ -76,6 +81,7 @@ Distributor.prototype._runNext = function(callback) {
|
||||
};
|
||||
|
||||
Distributor.prototype._updateBuild = function(build, callback) {
|
||||
callback = callback || _.noop;
|
||||
this.onBuildUpdate(build, callback);
|
||||
};
|
||||
|
||||
|
@ -27,11 +27,13 @@ Executor.prototype.run = function(params, callback) {
|
||||
project = _({}).extend(self.project, params);
|
||||
Steppy(
|
||||
function() {
|
||||
self.emit('currentStep', 'get sources');
|
||||
self._getSources(project.scm, this.slot());
|
||||
},
|
||||
function() {
|
||||
var funcs = project.steps.map(function(step) {
|
||||
var funcs = project.steps.map(function(step, index) {
|
||||
return function() {
|
||||
self.emit('currentStep', step.name || ('step ' + index));
|
||||
self._runStep(step, this.slot());
|
||||
};
|
||||
});
|
||||
|
@ -7,7 +7,7 @@
|
||||
},
|
||||
"steps": [
|
||||
{"type": "shell", "cmd": "echo \"hello, cur dir is `pwd`\""},
|
||||
{"type": "shell", "cmd": "sleep 4"},
|
||||
{"type": "shell", "name": "sleep", "cmd": "sleep 4"},
|
||||
{"type": "shell", "cmd": "echo 1 > 1.txt"},
|
||||
{"type": "shell", "cmd": "sleep 4"},
|
||||
{"type": "shell", "cmd": "echo 2 > 2.txt"},
|
||||
|
@ -5,7 +5,7 @@ define(['_dataio'], function(dataio) {
|
||||
var connect = dataio(socket);
|
||||
|
||||
/*
|
||||
* Extend resource
|
||||
* Extend Resource
|
||||
*/
|
||||
var resource = connect.resource('__someResource__'),
|
||||
resourcePrototype = Object.getPrototypeOf(resource);
|
||||
|
@ -30,6 +30,7 @@ html
|
||||
| <span>#<%= build.id %></span>
|
||||
| <span><%= build.project.name %></span>
|
||||
| <span><%= build.status %></span>
|
||||
| <span><%= build.currentStep && build.status === 'in-progress' ? '(' + build.currentStep + ')' : '' %></span>
|
||||
| <span class="js-show-console">↷</span>
|
||||
| </div>
|
||||
| <% }); %>
|
||||
|
Loading…
Reference in New Issue
Block a user