Package Exports
- pm2-deploy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pm2-deploy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Deploy system for PM2
This is the module that allows to do pm2 deploy.
Documentation: http://pm2.keymetrics.io/docs/usage/deployment/
Instalation
$ npm install pm2-deployProgrammatic Usage
var deployForEnv = require('pm2-deploy').deployForEnv;
// Define deploy configuration with target environments
var deployConfig = {
prod: {
user: 'node',
host: '212.83.163.168',
ref: 'origin/master',
repo: 'git@github.com:Unitech/eip-vitrine.git',
path: '/var/www/test-deploy'
},
dev: {
user: 'node',
host: '212.83.163.168',
ref: 'origin/master',
repo: 'git@github.com:Unitech/eip-vitrine.git',
path: '/var/www/test-dev'
}
};
// Invoke deployment for `dev` environment
deployForEnv(deployConfig, 'dev', [], function (err, args) {
if (err) {
console.error('Deploy failed:', err.message);
return console.error(err.stack);
}
console.log('Success!');
});
// Rollback `prod` environment
deployForEnv(deployConfig, 'prod', ['revert', 1], function (err, args) {
if (err) {
console.error('Rollback failed:', err.message);
return console.error(err.stack);
}
console.log('Success!');
});API
Table of Contents
deployForEnv
Deploy to a single environment
Parameters
deployConfigobject object containing deploy configs for all environmentsenvstring the name of the environment to deploy toargsarray custom deploy command-line argumentscbDeployCallback done callback
Returns boolean return value is always false
DeployCallback
Type: Function