Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devlab

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devlab - npm Package Compare versions

Comparing version 3.6.0 to 3.7.0

11

package.json
{
"name": "devlab",
"version": "3.6.0",
"version": "3.7.0",
"description": "Node utility for running containerized tasks",

@@ -33,3 +33,6 @@ "keywords": [

"e2e": "node test/system/run.js",
"lint": "standard --fix --verbose"
"lint": "standard --fix --verbose | snazzy",
"release:patch": "npm test && npm version patch && git push origin master && git push --tags && npm publish",
"release:minor": "npm test && npm version minor && git push origin master && git push --tags && npm publish",
"release:major": "npm test && npm version major && git push origin master && git push --tags && npm publish"
},

@@ -50,3 +53,2 @@ "homepage": "https://github.com/TechnologyAdvice/DevLab",

"dirty-chai": "^1.2.2",
"eslint": "^2.10.2",
"istanbul": "^0.4.3",

@@ -59,3 +61,4 @@ "mocha": "^2.3.3",

"sinon-chai": "^2.8.0",
"standard": "^8.5.0"
"snazzy": "^6.0.0",
"standard": "^8.6.0"
},

@@ -62,0 +65,0 @@ "dependencies": {

@@ -195,3 +195,6 @@ [![CircleCI branch](https://img.shields.io/circleci/project/TechnologyAdvice/DevLab/master.svg?maxAge=2592000)]()

**Global Setting:**
In addition to setting the `stopTimeSecs` per service, this property can be set in the root of the `devlab.yml` configuration and will be applied to any services that don't have an explicit `stopTimeSecs` property.
## Development

@@ -198,0 +201,0 @@

@@ -30,3 +30,3 @@ 'use strict'

*/
parseArgs: (type, args) => _.chain((item) => ([ command.args[type], command.parseHostEnvVars(item) ]), args),
parseArgs: (type, args) => _.chain((item) => ([command.args[type], command.parseHostEnvVars(item)]), args),
/**

@@ -107,9 +107,9 @@ * Parses config object and returns container name. Will have dl_ prefix and

const cwd = process.cwd()
let args = primary ? [ 'run', '--rm', '-it', '-v', `${cwd}:${cwd}`, '-v', `${tmpdir}:${tmpdir}`, '-w', cwd, '--privileged' ] : [ 'run', '-d', '--rm', '--privileged' ]
let args = primary ? ['run', '--rm', '-it', '-v', `${cwd}:${cwd}`, '-v', `${tmpdir}:${tmpdir}`, '-w', cwd, '--privileged'] : ['run', '-d', '--rm', '--privileged']
args = args.concat(_.flatten([
command.getArgs(cfg),
command.getLinks(cfg),
[ '--name', command.getName(name, cfg) ],
['--name', command.getName(name, cfg)],
cfg.from,
primary ? [ 'sh', `${tmpdir}/devlab.sh` ] : []
primary ? ['sh', `${tmpdir}/devlab.sh`] : []
]))

@@ -116,0 +116,0 @@ return primary ? { args, cmd: command.getExec(cfg) } : args

@@ -15,3 +15,3 @@ 'use strict'

const opts = { env: process.env, cwd: process.env.HOME }
opts.stdio = silent ? [ null, null, null ] : [ 'inherit', process.stdout, process.stdout ]
opts.stdio = silent ? [null, null, null] : ['inherit', process.stdout, process.stdout]
// Start

@@ -29,3 +29,3 @@ const p = cp.spawn('docker', args, opts)

runDetached: (cmd) => {
const p = cp.spawn('sh', [ '-c', cmd ], {
const p = cp.spawn('sh', ['-c', cmd], {
detached: true,

@@ -32,0 +32,0 @@ stdio: 'ignore'

@@ -42,2 +42,13 @@ 'use strict'

/**
* Returns stopTimeSecs prop from either the (1) service config (2) global config or (3) default
* @param {object} cfg Instance config object
* @param {object} svc Service config object
* @returns {number}
*/
getStopTimeSecs: (cfg, svc) => {
if (_.isType('number', svc.stopTimeSecs)) return svc.stopTimeSecs
if (_.isType('number', cfg.stopTimeSecs)) return cfg.stopTimeSecs
return 10
},
/**
* Gets all services and returns name, persistence, and arguments

@@ -53,3 +64,3 @@ * @param {Object} cfg Instance config object

persist: value.persist || false,
stopTimeSecs: _.isType('number', value.stopTimeSecs) ? value.stopTimeSecs : 10,
stopTimeSecs: services.getStopTimeSecs(cfg, value),
args: command.get(value, name, null)

@@ -90,3 +101,3 @@ })]), cfg.services),

_.filter(svc => _.test(/dl_/, svc.name)),
_.map(svc => proc.run([ 'stop', '-t', svc.stopTimeSecs, svc.name ], true).catch(() => errors.push(svc.name)))
_.map(svc => proc.run(['stop', '-t', svc.stopTimeSecs, svc.name], true).catch(() => errors.push(svc.name)))
])(services.running))

@@ -93,0 +104,0 @@ .then(() => {

@@ -61,3 +61,3 @@ 'use strict'

let data = _.split(/\s\s+/g, row)
return [ _.last(data), data[3] ]
return [_.last(data), data[3]]
}),

@@ -64,0 +64,0 @@ _.filter((data) => _.test(/dl_/, _.head(data))),

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc