pm2-deploy
Deployment system for PM2
Last updated 10 years ago by tknew .
AGPLV3 · Original npm · Tarball · package.json
$ npm install pm2-deploy 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (5 years ago)
  • 0.3.1                                ...           next (8 years ago)

25 Versions

  • 1.0.2                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 0.4.0                                ...           6 years ago
  • 0.3.10                                ...           6 years ago
  • 0.3.9                                ...           7 years ago
  • 0.3.8                                ...           7 years ago
  • 0.3.7                                ...           7 years ago
  • 0.3.6                                ...           7 years ago
  • 0.3.5                                ...           8 years ago
  • 0.3.4                                ...           8 years ago
  • 0.3.3                                ...           8 years ago
  • 0.3.2                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.1-1                                ...           8 years ago
  • 0.3.1-0                                ...           8 years ago
  • 0.2.1                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
  • 0.0.4                                ...           10 years ago
  • 0.0.3                                ...           10 years ago
  • 0.0.2                                ...           10 years ago
  • 0.0.1-beta                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE