pm2-deploy

Deployment system for PM2

MIT 25 个版本
安装
npm install pm2-deploy
yarn add pm2-deploy
pnpm add pm2-deploy
bun add pm2-deploy
README

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
版本列表
1.0.2 2020-04-13
1.0.1 2020-04-13
1.0.0 2020-04-13
0.4.0 2018-12-27
0.3.10 2018-07-17
0.3.9 2017-12-03
0.3.8 2017-09-28
0.3.7 2017-08-25
0.3.6 2017-08-16
0.3.5 2017-02-01
0.3.4 2017-01-19
0.3.3 2016-10-26
0.3.2 2016-10-26
0.3.1-1 2016-05-27
0.3.1-0 2016-05-27
0.3.1 2016-05-27
0.2.1 2015-09-23
0.2.0 2015-08-29
0.1.2 2014-10-20
0.1.1 2014-10-19
0.1.0 2014-09-08
0.0.4 2014-06-23
0.0.3 2014-06-20
0.0.2 2014-06-20
0.0.1-beta 2014-06-19