-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathecosystem.config.cjs
44 lines (41 loc) · 1.01 KB
/
ecosystem.config.cjs
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
/* eslint-disable no-undef, @typescript-eslint/no-require-imports */
let user, host;
try {
({ user, host } = require('./ecosystem-info.json'));
} catch {
user = 'ironmoon';
host = 'localhost';
}
module.exports = {
apps: [
...['', '-beta'].map((e) => ({
name: `tanzanite${e}`,
script: 'yarn',
args: 'start:raw',
out_file: `../tanzanite${e}.log`,
error_file: `../tanzanite${e}.log`,
max_memory_restart: '1G',
node_args: ['--max_old_space_size=2048'],
env: { FORCE_COLOR: '3' },
exp_backoff_restart_delay: 2500,
wait_ready: true
}))
],
deploy: {
...Object.fromEntries(
['production', 'beta'].map((e) => [
e,
{
user,
host,
'ref': `origin/${e === 'production' ? 'master' : 'beta'}`,
'repo': 'https://github.com/TanzaniteBot/tanzanite.git',
'path': `/code/tanzanite${e === 'beta' ? '-beta' : ''}`,
'post-deploy': `yarn install && yarn build && pm2 start ecosystem.config.cjs --only tanzanite${
e === 'beta' ? '-beta' : ''
}`
}
])
)
}
};