{"id":15984443,"url":"https://github.com/unitech/pm2-deploy","last_synced_at":"2025-05-16T04:04:03.336Z","repository":{"id":17917607,"uuid":"20883831","full_name":"Unitech/pm2-deploy","owner":"Unitech","description":"Deploy part of PM2","archived":false,"fork":false,"pushed_at":"2020-11-13T22:38:52.000Z","size":109,"stargazers_count":178,"open_issues_count":100,"forks_count":70,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-10T09:24:24.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pm2.keymetrics.io/docs/usage/deployment/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Unitech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-16T12:23:26.000Z","updated_at":"2024-05-12T16:22:37.000Z","dependencies_parsed_at":"2022-07-10T07:00:46.624Z","dependency_job_id":null,"html_url":"https://github.com/Unitech/pm2-deploy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fpm2-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fpm2-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fpm2-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fpm2-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Unitech","download_url":"https://codeload.github.com/Unitech/pm2-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464891,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T02:08:29.511Z","updated_at":"2025-05-16T04:04:03.319Z","avatar_url":"https://github.com/Unitech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy system for PM2\n\nThis is the module that allows to do `pm2 deploy`.\nDocumentation: http://pm2.keymetrics.io/docs/usage/deployment/\n\n[![build status](https://badgen.net/travis/Unitech/pm2/master)](https://travis-ci.org/Unitech/pm2-deploy) [![npm package version](https://badgen.net/npm/v/pm2-deploy)](https://npm.im/pm2-deploy) [![install size](https://badgen.net/packagephobia/install/pm2-deploy)](https://packagephobia.now.sh/result?p=pm2-deploy) [![github license](https://badgen.net/github/license/Unitech/pm2-deploy)](https://github.com/Unitech/pm2-deploy/blob/master/LICENSE) [![js semistandard style](https://badgen.net/badge/code%20style/semistandard/pink)](https://github.com/Flet/semistandard)\n\n## Instalation\n\n    $ npm install pm2-deploy\n\n## Programmatic Usage\n\n```js\nvar deployForEnv = require('pm2-deploy').deployForEnv;\n\n// Define deploy configuration with target environments\nvar deployConfig = {\n  prod: {\n    user: 'node',\n    host: '212.83.163.168',\n    ref: 'origin/master',\n    repo: 'git@github.com:Unitech/eip-vitrine.git',\n    path: '/var/www/test-deploy'\n  },\n  dev: {\n    user: 'node',\n    host: '212.83.163.168',\n    ref: 'origin/master',\n    repo: 'git@github.com:Unitech/eip-vitrine.git',\n    path: '/var/www/test-dev'\n  }\n};\n\n// Invoke deployment for `dev` environment\ndeployForEnv(deployConfig, 'dev', [], function (err, args) {\n  if (err) {\n    console.error('Deploy failed:', err.message);\n    return console.error(err.stack);\n  }\n  console.log('Success!');\n});\n\n// Rollback `prod` environment\ndeployForEnv(deployConfig, 'prod', ['revert', 1], function (err, args) {\n  if (err) {\n    console.error('Rollback failed:', err.message);\n    return console.error(err.stack);\n  }\n  console.log('Success!');\n});\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [deployForEnv](#deployforenv)\n    -   [Parameters](#parameters)\n-   [DeployCallback](#deploycallback)\n    -   [Parameters](#parameters-1)\n\n### deployForEnv\n\nDeploy to a single environment\n\n#### Parameters\n\n-   `deployConfig` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object containing deploy configs for all environments\n-   `env` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the environment to deploy to\n-   `args` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** custom deploy command-line arguments\n-   `cb` **[DeployCallback](#deploycallback)** done callback\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** return value is always `false`\n\n### DeployCallback\n\nType: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)\n\n#### Parameters\n\n-   `error` **[Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error)** deployment error\n-   `args` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** custom command-line arguments provided to deploy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitech%2Fpm2-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitech%2Fpm2-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitech%2Fpm2-deploy/lists"}