forever 替换成pm2
This commit is contained in:
@@ -4,9 +4,10 @@
|
|||||||
"description": "node服务端",
|
"description": "node服务端",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "forever -w --watchDirectory src index.js ",
|
"dev": "pm2 restart pm2.config.js --only dev --attach",
|
||||||
"pro": "forever start index.js",
|
"pro": "pm2 start pm2.config.js --only oms-node",
|
||||||
"stop": "forever stopall"
|
"deploy": "pm2 deploy pm2.config.js production",
|
||||||
|
"stop": "pm2 delete all"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
31
pm2.config.js
Normal file
31
pm2.config.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
module.exports = {
|
||||||
|
apps: [
|
||||||
|
{
|
||||||
|
name: 'dev',
|
||||||
|
script: "index.js",
|
||||||
|
watch: ["src", "tpl"],
|
||||||
|
ignore_watch: ["node_modules"],
|
||||||
|
shutdown_with_message: true,
|
||||||
|
env: {
|
||||||
|
"NODE_ENV": "development",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'oms-node',
|
||||||
|
script: "index.js",
|
||||||
|
env: {
|
||||||
|
"NODE_ENV": "production",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
deploy: {
|
||||||
|
production: {
|
||||||
|
user: 'root',
|
||||||
|
host: '192.168.1.87',
|
||||||
|
ref: 'origin/dev',
|
||||||
|
repo: 'http://git.sinoecare.com/lab/dvcp-node-service.git',
|
||||||
|
path: '/home/deploy',
|
||||||
|
postDeploy: "npm run pro"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
./shell/update.sh node服务 .
|
./shell/update.sh oms-node服务 .
|
||||||
forever stopall
|
|
||||||
npm run pro
|
npm run pro
|
||||||
|
|||||||
Reference in New Issue
Block a user