Comparing version 1.5.2 to 1.5.3
@@ -61,3 +61,3 @@ /* | ||
* Builds command arguments for executing task | ||
* @returns {String} The command to execute the task | ||
* @returns {Array} The command to execute the task | ||
*/ | ||
@@ -68,2 +68,3 @@ buildArgs: function buildArgs() { | ||
var volumes = core.manifest.volumes ? _libParsers2['default'].parseVolumes(core.manifest.volumes) : []; | ||
var hosts = core.manifest.hosts ? _libParsers2['default'].parseHostMap(core.manifest.hosts) : []; | ||
// Spawn arguments | ||
@@ -87,2 +88,3 @@ var mode = core.manifest.interactive || process.stdout.isTTY ? '-it' : '-t'; | ||
args = volumes.length ? args.concat(volumes) : args; | ||
args = hosts.length ? args.concat(hosts) : args; | ||
args = args.concat(workdir); | ||
@@ -89,0 +91,0 @@ args = args.concat(name); |
@@ -38,3 +38,18 @@ 'use strict'; | ||
}, | ||
/** | ||
* Parse /etc/hosts mappings | ||
* @param {Object} map A mapping of hostname to IP address | ||
* @returns {Array} an array of Docker arguments to set up the host maps. | ||
*/ | ||
parseHostMap: function parseHostMap(map) { | ||
var args = []; | ||
_lodash2['default'].forOwn(map, function (val, key) { | ||
args.push('--add-host'); | ||
args.push(key + ':' + val); | ||
}); | ||
return args; | ||
}, | ||
/** | ||
* Process environment variables | ||
@@ -41,0 +56,0 @@ * @param {Array} env Array of environment variables |
{ | ||
"name": "devlab", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Node utility for running containerized tasks", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -59,2 +59,4 @@ # DevLab | ||
- ${HOME}/.ssh:/root/.ssh | ||
hosts: | ||
google.com: 127.0.0.1 | ||
quiet: false | ||
@@ -132,2 +134,6 @@ before-task: | | ||
#### `hosts` | ||
Maps a hostname to an IP address in the container's `/etc/hosts` file. | ||
#### `volumes` | ||
@@ -134,0 +140,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44158
802
221
4