dockerode-process
Advanced tools
Comparing version 0.1.0 to 0.2.0
suite('docker process', function() { | ||
var DockerRun = require('./'); | ||
var docker = require('./test/docker')(); | ||
var subject; | ||
teardown(function() { | ||
return subject && subject.remove(); | ||
}); | ||
suite('emits container', function() { | ||
setup(function() { | ||
subject = new DockerRun(docker, { | ||
create: { | ||
Image: 'ubuntu', | ||
Cmd: ['/bin/bash', '-c', 'echo stdout && echo stderr >&2'], | ||
Tty: true | ||
}, | ||
start: {} | ||
}); | ||
}); | ||
test('once emitted', function(done) { | ||
subject.once('container', function(container) { | ||
assert.ok(subject.container, 'has container'); | ||
assert.equal(subject.container, container); | ||
done(); | ||
}); | ||
subject.run(); | ||
}); | ||
}); | ||
suite('#run - with pull', function() { | ||
var subject; | ||
setup(function() { | ||
@@ -35,3 +63,2 @@ subject = new DockerRun(docker, { | ||
suite('#run - with tty', function() { | ||
var subject; | ||
setup(function() { | ||
@@ -65,3 +92,2 @@ subject = new DockerRun(docker, { | ||
suite('#run - without tty (no pull)', function() { | ||
var subject; | ||
setup(function() { | ||
@@ -117,3 +143,2 @@ subject = new DockerRun(docker, { | ||
suite('#remove', function() { | ||
var subject; | ||
setup(function() { | ||
@@ -138,2 +163,4 @@ subject = new DockerRun(docker, { | ||
function() { | ||
// set subject to null to avoid multiple remove's | ||
subject = null; | ||
// yey it works | ||
@@ -140,0 +167,0 @@ } |
@@ -86,2 +86,3 @@ var EventEmitter = require('events').EventEmitter; | ||
this.container = container = docker.getContainer(_container.id); | ||
this.emit('container', container); | ||
return container.attach(attachConfig); | ||
@@ -88,0 +89,0 @@ }.bind(this) |
{ | ||
"name": "dockerode-process", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "ChildProcess like interface for docker containers", | ||
@@ -5,0 +5,0 @@ "main": "docker_process.js", |
@@ -87,2 +87,8 @@ | ||
dockerProc.run(); | ||
// a reference to the container can be obtained by waiting for the | ||
// container event | ||
dockerProc.once('container', function(container) { | ||
}); | ||
dockerProc.stdout.pipe(process.stdout); | ||
@@ -89,0 +95,0 @@ dockerProc.once('exit', function(code) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15869
10
401
98