fuge-runner
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -153,2 +153,3 @@ /* eslint handle-callback-err: 0*/ | ||
c.name = c.name + '_' + commandName | ||
c.type = 'process' | ||
start(system, 'live', c, exitCb(cb), function (err, child) { | ||
@@ -163,5 +164,5 @@ | ||
monitor: false, | ||
tail: c.tail} | ||
tail: true} | ||
util.streamOutput({process: process, name: c.name}, system.global.log_path) | ||
util.streamOutput({process: process, name: c.name, tail: true}, system.global.log_path, true) | ||
}) | ||
@@ -168,0 +169,0 @@ } |
@@ -64,6 +64,10 @@ /* jshint -W069 */ | ||
var streamOutput = function (container, logPath) { | ||
var streamOutput = function (container, logPath, hidePid) { | ||
var colorizer = split(function (line) { | ||
if (container.tail) { | ||
return container.process.colour('[' + container.name + ' - ' + container.process.child.pid + ']: ' + line) + '\n' | ||
if (hidePid) { | ||
return container.process.colour(line) + '\n' | ||
} else { | ||
return container.process.colour('[' + container.name + ' - ' + container.process.child.pid + ']: ' + line) + '\n' | ||
} | ||
} | ||
@@ -90,3 +94,2 @@ }) | ||
function tokenizeQuoted (str, quote) { | ||
@@ -111,2 +114,6 @@ var tokens = [].concat.apply([], str.split(quote).map(function (v, i) { | ||
} | ||
if (toks.length === 3 && (toks[0] === 'bash' || toks[0] === 'cmd') && (toks[1] === '-c' || toks[1] === '/c')) { | ||
toks[2] = toks[2].replace(/["\\']/g, '') | ||
} | ||
return toks | ||
@@ -113,0 +120,0 @@ } |
@@ -175,3 +175,3 @@ /* | ||
console.log('starting: ' + container.name + ' [' + container.run + ']') | ||
console.log('starting: ' + container.name + ' [' + (container.run ? container.run : container.image) + ']') | ||
container.debugMode = debugMode | ||
@@ -198,3 +198,9 @@ delay(container, function () { | ||
var startAll = function (system, cb) { | ||
async.eachSeries(_.keys(system.topology.containers), function (key, next) { | ||
var keys = _.keys(system.topology.containers) | ||
var ckeys | ||
ckeys = _.remove(keys, function (el) { return system.topology.containers[el].type === 'container' || system.topology.containers[el].type === 'docker' }) | ||
ckeys = ckeys.concat(keys) | ||
async.eachSeries(ckeys, function (key, next) { | ||
var container = system.topology.containers[key] | ||
@@ -201,0 +207,0 @@ |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -63,2 +63,3 @@ "author": "Peter Elger (http://nearform.com/)", | ||
"coveralls": "^2.11.14", | ||
"fuge-config": "beta", | ||
"json-stringify-safe": "^5.0.1", | ||
@@ -65,0 +66,0 @@ "pre-commit": "^1.1.3", |
@@ -24,2 +24,3 @@ /* | ||
var previewer = require('./lib/commands/preview')() | ||
var shell = require('./lib/commands/shell')() | ||
var system = require('./lib/system')() | ||
@@ -42,2 +43,5 @@ | ||
shell: function (sysDef, command, cb) { shell.shell(sysDef, command, cb) }, | ||
apply: function (sysDef, command, cb) { shell.apply(sysDef, command, cb) }, | ||
start: function (sysDef, name, cb) { system.start(sysDef, name, false, cb) }, | ||
@@ -44,0 +48,0 @@ debug: function (sysDef, name, cb) { system.start(sysDef, name, true, cb) }, |
Sorry, the diff of this file is not supported yet
109855
61
2669
10
10