Socket
Socket
Sign inDemoInstall

pm2-deploy

Package Overview
Dependencies
2
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pm2-deploy

Deployment system for PM2


Version published
Weekly downloads
1.1M
decreased by-10.15%
Maintainers
2
Install size
119 kB
Created
Weekly downloads
 

Package description

What is pm2-deploy?

The pm2-deploy npm package is a module for PM2, which allows users to perform deployment tasks for their applications. It simplifies the process of updating, reverting, and managing deployments directly from the command line.

What are pm2-deploy's main functionalities?

Setup

Initializes the remote production environment, setting up the necessary directories and configurations for deployment.

pm2 deploy production setup

Deployment

Deploys the application to the production environment as specified in the ecosystem configuration file.

pm2 deploy ecosystem.config.js production

Update

Updates the deployment with the latest changes from the source without a full redeployment.

pm2 deploy production update

Revert

Reverts to the previous deployment (or a specified number of revisions back) in case of deployment issues.

pm2 deploy production revert 1

Execution of custom commands

Executes a custom command on the remote server, such as reloading all PM2 processes.

pm2 deploy production exec 'pm2 reload all'

Other packages similar to pm2-deploy

Readme

Source

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

FAQs

Last updated on 13 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc