pm2-deploy (1.0.2)

Published 2026-02-24 14:02:43 +00:00 by atheaadmin

Installation

registry=
npm install pm2-deploy@1.0.2
"pm2-deploy": "1.0.2"

About this package

Deploy system for PM2

This is the module that allows to do pm2 deploy. Documentation: http://pm2.keymetrics.io/docs/usage/deployment/

build status npm package version install size github license js semistandard style

Instalation

$ npm install pm2-deploy

Programmatic 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

  • deployConfig object object containing deploy configs for all environments
  • env string the name of the environment to deploy to
  • args array custom deploy command-line arguments
  • cb DeployCallback done callback

Returns boolean return value is always false

DeployCallback

Type: Function

Parameters

  • error Error deployment error
  • args array custom command-line arguments provided to deploy

Dependencies

Dependencies

ID Version
run-series ^1.1.8
tv4 ^1.3.0

Development Dependencies

ID Version
better-assert ^1.0.2
documentation ^11.0.0
eslint ^5.16.0
eslint-config-semistandard ^13.0.0
eslint-config-standard ^12.0.0
eslint-plugin-import ^2.14.0
eslint-plugin-node ^8.0.1
eslint-plugin-promise ^4.0.1
eslint-plugin-standard ^4.0.0
mocha ^5.2.0
should ^13.2.3
Details
npm
2026-02-24 14:02:43 +00:00
1
Alexandre Strzelewicz
MIT
latest
6.1 KiB
Assets (1)
Versions (1) View all
1.0.2 2026-02-24