-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathecosystem.config.js
79 lines (53 loc) · 1.87 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps: [
// First application
{
name: 'landing-page',
script: 'npm start',
env: {
COMMON_VARIABLE:
'true'
},
env_production: {
NODE_ENV:
'production'
}
},
],
/**
* Deployment section
* http://pm2.keymetrics.io/docs/usage/deployment/
*/
deploy: {
production: {
key: '/Users/shankarkd/.ssh/id_rsa',
user: 'ubuntu',
// key: "/Users/Juico/.ssh/id_rsa",
host: ['18.223.166.15'],
ref: 'origin/master',
ssh_options: ["StrictHostKeyChecking=no", "PasswordAuthentication=no", "ForwardAgent=yes"],
repo: 'git@github.com:five-of-seven/landing-page.git',
path: '/landing-page',
'pre-setup':
"ls -la; sudo mkdir /landing-page ; sudo chown -R ubuntu.ubuntu /landing-page ; " +
"sudo curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - ; " +
"sudo apt-get install -y nodejs ; " +
"sudo npm install pm2 -g ; ",
'pre-deploy':
'sudo mkdir /landing-page ; ' +
'sudo mkdir /landing-page/source ; sudo mkdir /landing-page/shared ;' +
'sudo chown -R ubuntu.ubuntu /landing-page',
'pre-deploy-local':
"echo 'This is a local executed command'",
'post-deploy':
'sudo npm install && ' +
'sudo pm2 reload ecosystem.config.js --env production'
// 'sudo pm2 restart landing-page && ' +
// 'sudo pm2 start'
},
}
};