{"_id":"node-deployer","_rev":"19-730a17d7f7d567b8b89dc3187d1c44af","name":"node-deployer","time":{"modified":"2022-06-21T13:38:18.140Z","created":"2015-02-07T09:44:28.351Z","0.0.1":"2015-02-07T09:44:28.351Z","0.0.2":"2015-02-07T09:45:35.619Z","0.1.0":"2017-12-10T06:56:07.739Z","0.1.1":"2017-12-10T06:57:14.453Z","0.1.2":"2017-12-10T10:30:24.288Z","0.1.3":"2017-12-10T10:32:38.219Z","0.1.4":"2017-12-10T10:51:32.981Z","0.1.5":"2017-12-10T11:22:35.995Z","1.0.0":"2018-04-02T09:05:38.393Z","1.0.1":"2018-04-02T09:09:17.737Z"},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"dist-tags":{"latest":"1.0.1"},"description":"Excute command in target server via ssh2 protocol.","readme":"# What this\n\nExcute command in target server via ssh2 protocol.\n\n## How to install\n\n```bash\n$ npm install node-deployer --save-dev\n```\n\n## Configurations\n\n### Task\n\nTask is the special linux command to excute.\n\n- **name**: task description.\n- **command**: the command to excute.\n- **priority**: the priority of this task, tasks will be sorted by their priority before excution.\n- **stage**: only run this task in some stages server.\n- **workDir**: where the command to excute.\n\n### Proxy\n\nSpecify the proxy server when your server is behind a forward agent server (ssh hopping).\n\nsee [node-ssh2 client connect configuration](https://github.com/mscdex/ssh2#client-methods).\n\n### Server\n\n- **useProxy**: if true, it will connect via proxy server, `Default: false`.\n- **stage**: the server stage.\n- **releasePath**: your application release path.\n- **connectOptions**: see [node-ssh2 client connect configuration](https://github.com/mscdex/ssh2#client-methods).\n\n## Events\n\n- **ready**: when all clents connected, this event will be fire.\n- **done**: All task completed.\n\n## Methods\n\n- **setLogger(< object >logger)**: replace logger instance.\n- **setProxy(< object >options)**: replace proxy instance.\n- **addServer(< object >options, < function >callback)**: add a remote server.\n- **removeServer(< string >name, < function >callback)**: remove a remote server.\n- **addTask(< object >options)**: add a task.\n- **removeTask(< string >name)**: remove a task.\n- **sort(< function >callback)**: sort all tasks, default sort by priority.\n- **start()**: start to excute all tasks.\n\n## Use with grunt and gulp\n\n- **Grunt Plugin**: https://github.com/charleslxh/grunt-dep\n- **Gulp Plugin**: https://github.com/charleslxh/gulp-dep\n\n## Examples\n\n```js\nconst Dep = require('node-deployer');\n\nconst options = {\n    \"tasks\": [\n        {\n            \"name\": \"list all files in /var/www\",\n            \"command\": \"ls -la\",\n            \"priority\": 0,\n            \"stages\": [\"prod\", \"test\"],\n            \"workDir\": \"/var/www\"\n        }\n    ,\n        {\n            \"name\": \"show the absolute path of application release path\",\n            \"command\": \"pwd\",\n            \"priority\": 0,\n            \"stages\": [\"prod\", \"test\"]\n        }\n    ],\n    \"proxy\": {\n        \"host\": \"192.168.51.222\",\n        \"port\": 22,\n        \"username\": \"proxy_user_name\",\n        \"privateKey\": fs.readFileSync(path.resolve(os.homedir(), \".ssh/id_rsa\"))\n    },\n    \"servers\": [\n        {\n            \"useProxy: false\",\n            \"stage\": \"test\",\n            \"releasePath\": \"/var/www/app\",\n            \"connectOptions\": {\n                \"name\": \"s1\",\n                \"host\": \"192.168.51.223\",\n                \"port\": 22,\n                \"username\": \"user\",\n                \"password\": \"123456\"\n            }\n        }\n    ]\n}\n\nconst dep = new Dep(options);\n\ndep.on('ready', dep.start);\ndep.on('done', () => console.log('tasks completed'));\n```\n","versions":{"0.1.0":{"name":"node-deployer","version":"0.1.0","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"chalk":"^2.3.0","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"dep":"./bin/dep"},"gitHead":"91b1f6a932c900bf3330116125f65e5f9b02200c","_id":"node-deployer@0.1.0","_shasum":"f1efe80a6b53df0311867f12bf11b004782adc1e","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"f1efe80a6b53df0311867f12bf11b004782adc1e","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.0.tgz","integrity":"sha512-V5mpfpMKElAWBKBnQuxMzaRmlTCpu/2ZfcUYiWqgsn14tKw/PMS4nuQbPsVOf8yQNw904YX+0rnuB9SuivHbUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiuvTkOXZHpq8NXHzNkeJLFWv1UJjmpa0hHQP8Y4x+DwIhAJbLG7kCSS4qD9CAoyuQBnB6xFAvLDYTsVoDMFBRiOqs"}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.0.tgz_1512888967674_0.1843013425823301"},"directories":{}},"0.1.1":{"name":"node-deployer","version":"0.1.1","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"chalk":"^2.3.0","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"dep":"./bin/dep"},"gitHead":"f5185450e25ae4d832c4b694f4d70bc60a97e192","_id":"node-deployer@0.1.1","_shasum":"02f2eab682bc5dc6c5fd0bb8c4c1b55806ea4679","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"02f2eab682bc5dc6c5fd0bb8c4c1b55806ea4679","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.1.tgz","integrity":"sha512-QQCaQTh22OX9cD+g3HMWPm4zxMzgB2dD9gjb3lNTO83DfjiJCqB1lwN1x9yg+HiBuECN/oHiCHkAGLH79OEubA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCppni3vTyvpT0ppsJPIf7fxI6PYahU87uWVlb14GZTrQIhAKYJefRKsgLCJDsp+lkYrJur5lQfuvIh1hiOuHXM86QZ"}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.1.tgz_1512889034225_0.23828292964026332"},"directories":{}},"0.1.2":{"name":"node-deployer","version":"0.1.2","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"chalk":"^2.3.0","commander":"^2.12.2","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"dep":"./bin/dep.js"},"gitHead":"ef7349524bbaf7236a7d1ec818cdfab23aaeadc4","_id":"node-deployer@0.1.2","_shasum":"014e93888977cede46ea97aebcd49fbbc056d67f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"014e93888977cede46ea97aebcd49fbbc056d67f","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.2.tgz","integrity":"sha512-ISjwctzkVXRLmYBRJeIiQnyayr242OeMmLB/6/u7cLNJU8OodpfvLQhjm5rEi52Bk8UWtxbtyiW0owg7rK3VQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7DGmI6zvkaeMnr1b0y0r9vHP18tlovV62ssKJC/jpsAIhAIo6iHdlG8Tf5OQSuFD8jh/OxX0vmizgr/Q2+K7+I2YQ"}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.2.tgz_1512901824217_0.4549313865136355"},"directories":{}},"0.1.3":{"name":"node-deployer","version":"0.1.3","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"chalk":"^2.3.0","commander":"^2.12.2","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"depl":"./bin/dep.js"},"gitHead":"ef7349524bbaf7236a7d1ec818cdfab23aaeadc4","_id":"node-deployer@0.1.3","_shasum":"9f571e7897f1a857fe1e22973fcccd4d9e710b72","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"9f571e7897f1a857fe1e22973fcccd4d9e710b72","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.3.tgz","integrity":"sha512-2iyosvQ02/ISvCtX4/yF5J13jmnAs8Sb39EwG4wBs7+W8oMmkajjifJvyXn+ImAcTdeCdrf8+Oos4U1JskVoxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAb1Vcc0cqimo5P9wqiSPB3W+Ob6Zr34y2vt0uLx065ZAiAUYc+fgwq7BofItox1TIYlTleB9ERhmNkhpJrC3F6igQ=="}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.3.tgz_1512901958115_0.9288369175046682"},"directories":{}},"0.1.4":{"name":"node-deployer","version":"0.1.4","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"babel-runtime":"^6.26.0","chalk":"^2.3.0","commander":"^2.12.2","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"depl":"./bin/dep.js"},"gitHead":"98ac63a5b8393121488fead870406351423d8c0e","_id":"node-deployer@0.1.4","_shasum":"b4df01662538bca2abc81f7250ce84bc1ad48a8b","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"b4df01662538bca2abc81f7250ce84bc1ad48a8b","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.4.tgz","integrity":"sha512-v/cW2C9fIQk+JIfoQSUHf9ciA3izSAd0zxKAMAZ+k5hrGxjf/m4WaC2u+Fksw2oBqkU+FU2oNaNe2Wz+e8F4Kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjWYqFSp+95gLZu/kqnFwiRXI2wQXbwibMk0A/rSiKjAiEA2vT+Byv/LNjAR0B6Z41WF63ci5YhqSv/bLNLR6cKx0A="}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.4.tgz_1512903092904_0.9854217546526343"},"directories":{}},"0.1.5":{"name":"node-deployer","version":"0.1.5","description":"A deployment tool written in NodeJS with support for popular frameworks out of the box. Edit","main":"src/main.js","scripts":{"test":"npm test"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/deployer.git"},"keywords":["NodeJS","Deployer","tool"],"author":{"name":"Charles Liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/deployer/issues"},"homepage":"https://github.com/charleslxh/deployer#readme","dependencies":{"babel-runtime":"^6.26.0","chalk":"^2.3.0","commander":"^2.12.2","ssh2":"^0.5.5"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","bluebird":"^3.5.1","del":"^3.0.0","gulp":"^3.9.1","gulp-babel":"^7.0.0","gulp-error-handle":"^1.0.0","gulp-util":"^3.0.8","run-sequence":"^2.2.0","webpack":"^3.9.1"},"bin":{"depl":"./bin/dep.js"},"gitHead":"27ca6f076bbeaf0f86087760f16dc7316de44f48","_id":"node-deployer@0.1.5","_shasum":"6e8cc51da3079217634c6d7aa954f0f8a6b6b1ca","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"shasum":"6e8cc51da3079217634c6d7aa954f0f8a6b6b1ca","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-0.1.5.tgz","integrity":"sha512-Ln0k0T0Tns0yRvNGRTigN+kYIcEBCePHNBzpoxAI0aUffyJ3fvjOYP1W9BA/JlpUanTllmcFEkIZs4y6BPuBRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvk+XtsG/0yywu6AdIpf7vPMcJE0AvfZfdb3PknYG3CQIgJhjljxVM0zuiCDcc67SEimYKyDcL8xPghWCNKiAC7C4="}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer-0.1.5.tgz_1512904955844_0.4183643711730838"},"directories":{}},"1.0.0":{"name":"node-deployer","version":"1.0.0","description":"Excute command in target server via ssh2 protocol.","main":"lib/index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/node-dep.git"},"keywords":["nodejs","ssh2","deploy"],"author":{"name":"charles.liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/node-dep/issues"},"homepage":"https://github.com/charleslxh/node-dep#readme","gitHead":"f3b77494447d15d8429e931fbd70cc4f32ae257f","_id":"node-deployer@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"integrity":"sha512-eVYnGwGrk1ceyQeAUr4vBx2WIxz/SbS86zXI736xckNJ0Zrd0E+l0Cx6dyuNelmjqwU/3grHAnsWhLCUFNp1SQ==","shasum":"a7feebc8eed535a3073c064df4549889765dbab0","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-1.0.0.tgz","fileCount":8,"unpackedSize":19979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxJqFfeXOceaDXLOjGBAnTjIzqQcmUkub35nYvAHWbUAiEAoDuezOvCrJzIIFMPdFcMbDCNOkvQlqoCPJt4VzLG9RU="}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer_1.0.0_1522659938263_0.985114723034533"},"_hasShrinkwrap":false},"1.0.1":{"name":"node-deployer","version":"1.0.1","description":"Excute command in target server via ssh2 protocol.","main":"lib/index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/charleslxh/node-dep.git"},"keywords":["nodejs","ssh2","deploy"],"author":{"name":"charles.liao"},"license":"MIT","bugs":{"url":"https://github.com/charleslxh/node-dep/issues"},"homepage":"https://github.com/charleslxh/node-dep#readme","dependencies":{"ssh2":"^0.6.0"},"gitHead":"ee2cf95074c0a7f1a78a94137de27233d1e926de","_id":"node-deployer@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"charleslxh","email":"charleslxh@icloud.com"},"dist":{"integrity":"sha512-UeOx3jnFtvANBJCl6BLOp2ajGZ0XexRluWom63zd003qPK62kAVPcvDBdBu8YnL+sUxKoy3pQOsrqoP7CAXv3w==","shasum":"62d5ffed44810add8a4638a51023d7fc77e438d8","tarball":"https://registry.npmjs.org/node-deployer/-/node-deployer-1.0.1.tgz","fileCount":8,"unpackedSize":20035,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQ6J/WbmrEG4SKqKzjDpHmqsg1C0nNDJ/ZdyG2fpm+TAiEA4I0wjBv1sq4kJrZvcWn1NnIH/EK1t3lDu4xoqA+Oxec="}]},"maintainers":[{"name":"charleslxh","email":"charleslxh@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-deployer_1.0.1_1522660157651_0.5473715371148056"},"_hasShrinkwrap":false}},"homepage":"https://github.com/charleslxh/node-dep#readme","keywords":["nodejs","ssh2","deploy"],"repository":{"type":"git","url":"git+https://github.com/charleslxh/node-dep.git"},"author":{"name":"charles.liao"},"bugs":{"url":"https://github.com/charleslxh/node-dep/issues"},"license":"MIT","readmeFilename":"README.md","users":{"charleslxh":true}}