-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathecosystem.config.js
44 lines (41 loc) · 1.23 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
const sshOptions = ['StrictHostKeyChecking=no'];
if (process.env.SSH_AUTH_SOCK) {
sshOptions.push(`IdentityFile=${process.env.SSH_AUTH_SOCK}`);
}
const deployShared = {
user: 'ci_agent',
host: 'egg-party.com',
repo: 'https://github.com/cakekindel/egg-party.git',
ssh_options: sshOptions,
};
module.exports = {
apps: [
{
name: 'production',
script: '/home/site/current/dist/src/main.js',
max_memory_restart: '500M',
autorestart: true
},
{
name: 'development',
script: '/home/site_dev/current/dist/src/main.js',
max_memory_restart: '250M',
autorestart: false
},
],
deploy: {
production: {
...deployShared,
ref: 'origin/master',
path: '/home/site',
'post-deploy': '.scripts/postdeploy.sh production',
},
development: {
...deployShared,
ref: process.env.DEVELOPMENT_BRANCH || 'origin/master',
path: '/home/site_dev',
'pre-deploy': 'git checkout ' + process.env.DEVELOPMENT_BRANCH || 'master',
'post-deploy': '.scripts/postdeploy.sh development',
},
},
};