mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 18:46:17 +00:00
create data resource for completed build
This commit is contained in:
parent
2af6ddbfb1
commit
80fbc4e902
@ -16,16 +16,29 @@ define([
|
||||
output = '',
|
||||
resourceName = 'build' + build.id;
|
||||
|
||||
connect.resource(resourceName).reconnect();
|
||||
connect.resource(resourceName).subscribe('data', function(data) {
|
||||
output += data;
|
||||
var connectToBuildDataResource = function() {
|
||||
connect.resource(resourceName).reconnect();
|
||||
connect.resource(resourceName).subscribe('data', function(data) {
|
||||
output += data;
|
||||
|
||||
self.trigger({
|
||||
buildId: build.id,
|
||||
name: 'Console for build #' + build.id,
|
||||
data: output
|
||||
self.trigger({
|
||||
buildId: build.id,
|
||||
name: 'Console for build #' + build.id,
|
||||
data: output
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// create data resource for completed build
|
||||
if (build.status === 'done' || build.status === 'error') {
|
||||
connect.resource('projects')
|
||||
.sync('createBuildDataResource', function(err) {
|
||||
if (err) throw err;
|
||||
connectToBuildDataResource();
|
||||
});
|
||||
} else {
|
||||
connectToBuildDataResource();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user