-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
65 lines (63 loc) · 2.35 KB
/
ecosystem.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps : [
// First application
{
name : 'webpack',
script : './node_modules/webpack/bin/webpack.js',
watch : true,
ignore_watch : ["babel_cache", "npm-debug.log", "src/public/js/bundle.js", "package-lock.json", ".git"],
autorestart : false,
// Environment variables injected when starting with --env production
// http://pm2.keymetrics.io/docs/usage/application-declaration/#switching-to-different-environment
env_production : {
NODE_ENV: 'production'
},
env_dev : {
NODE_ENV: 'development'
},
env: {
USER: 'ubuntu'
},
},
// Main application
{
name : 'slong',
script : 'src/server.js',
env: {
USER: 'ubuntu'
},
instances: 0,
exec_mode: 'cluster'
},
],
/**
* Deployment section
* http://pm2.keymetrics.io/docs/usage/deployment/
*/
deploy : {
production : {
user : 'ubuntu',
host : 'stephenlong.jedimasters.net',
key : '~/.ssh/jedimasters.pem',
ref : 'origin/master',
repo : 'git@github.com:lalong13/slong.git',
path : '/home/$USER/Node',
'pre-deploy' : 'rm package-lock.json; npm install; pm2 install pm2-githook; mkdir -p /home/$USER/.pm2 && cp module_conf.json /home/$USER/.pm2/',
'post-deploy' : 'pm2 restart pm2-githook && pm2 startOrRestart ecosystem.config.js --env production && pm2 save'
},
dev : {
user : 'ubuntu',
host : 'stephenlong.jedimasters.net',
key : '~/.ssh/jedimasters.pem',
ref : 'origin/master',
repo : 'git@github.com:lalong13/slong.git',
path : '/home/$USER/Node',
'pre-deploy' : 'rm package-lock.json; npm install; pm2 install pm2-githook; mkdir -p /home/$USER/.pm2 && cp module_conf.json /home/$USER/.pm2/',
'post-deploy' : 'pm2 restart pm2-githook && pm2 startOrRestart ecosystem.config.js --env dev'
}
}
};