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

pm2-deploy

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pm2-deploy - npm Package Compare versions

Comparing version 0.3.10 to 0.4.0

51

deploy.js

@@ -15,3 +15,7 @@ var fs = require('fs');

function spawn(hostJSON, args, cb) {
var shellSyntaxCommand = "echo '" + hostJSON + "' | \"" + __dirname.replace(/\\/g, '/') + "/deploy\" " + args.join(' ');
var shellSyntaxCommand = "echo '" + hostJSON + "' | \"" + __dirname.replace(/\\/g, '/') + "/deploy\" "
if (args.length > 0)
shellSyntaxCommand += '"' + args.join('" "') + '"';
var proc = childProcess.spawn('sh', ['-c', shellSyntaxCommand], { stdio: 'inherit' });

@@ -26,3 +30,5 @@ var error;

if (code == 0) return cb(null, args);
else return cb(error || code);
else {
return cb(error || code);
}
});

@@ -90,2 +96,5 @@ }

var originalPostDeploy = typeof target_conf['post-deploy'] === 'string'
? target_conf['post-deploy']
: '';
if (Array.isArray(target_conf.host)) {

@@ -100,6 +109,8 @@ series(target_conf.host.reduce(function (jobs, host) {

target_conf.host = host;
target_conf['post-deploy'] = 'export ' + objectToEnvVars(target_conf.env) + ' && ' + target_conf['post-deploy']
var custom_data = JSON.stringify(target_conf);
target_conf['post-deploy'] = prependEnvVars(
originalPostDeploy,
objectToEnvVars(target_conf.env)
);
spawn(custom_data, args, done);
spawn(JSON.stringify(target_conf), args, done);
});

@@ -114,3 +125,7 @@ return jobs;

target_conf['post-deploy'] = 'export ' + objectToEnvVars(target_conf.env) + ' && ' + target_conf['post-deploy']
target_conf['post-deploy'] = prependEnvVars(
originalPostDeploy,
objectToEnvVars(target_conf.env)
);
spawn(JSON.stringify(target_conf), args, cb);

@@ -128,16 +143,8 @@ }

function run() {
var conf = JSON.parse(fs.readFileSync('app.json'));
var args = process.argv;
if (args.indexOf('deploy') == -1)
throw new Error('deploy argument not found');
args.splice(0, args.indexOf('deploy') + 1);
var env = args[0];
deployForEnv(conf.deploy, env, args, function (err, data) {
console.log(arguments);
});
/**
* @param {string} cmd
* @param {string} envVars
*/
function prependEnvVars(cmd, envVars) {
return (envVars && 'export ' + envVars + (cmd && ' && ')) + cmd;
}

@@ -148,5 +155,1 @@

};
if (require.main === module) {
run();
}
{
"name": "pm2-deploy",
"version": "0.3.10",
"version": "0.4.0",
"description": "Deployment system for PM2",
"main": "deploy.js",
"engines": {
"node": ">=4.0.0"
},
"repository": {

@@ -11,3 +14,3 @@ "type": "git",

"scripts": {
"test": "mocha"
"test": "mocha --exit"
},

@@ -20,3 +23,3 @@ "dependencies": {

"better-assert": "^1.0.0",
"mocha": "^3.5",
"mocha": "^5.2",
"should": "^13"

@@ -23,0 +26,0 @@ },

@@ -7,2 +7,2 @@

[![NPM version](https://badge.fury.io/js/pm2-deploy.png)](http://badge.fury.io/js/pm2)
[![Build Status](https://api.travis-ci.org/Unitech/pm2-deploy.png?branch=master)](https://travis-ci.org/Unitech/PM2)
[![Build Status](https://api.travis-ci.org/Unitech/pm2-deploy.png?branch=master)](https://travis-ci.org/Unitech/pm2-deploy)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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