-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
52 lines (51 loc) · 1.82 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
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps : [
// First application
{
name : 'SlackOps',
script : 'index.js',
instances : 'max',
exec_mode : 'cluster',
env: {
COMMON_VARIABLE: 'true'
},
env_production : {
NODE_ENV: 'production',
PORT: '3000'
}
},
],
deploy : {
// "production" is the environment name
production : {
//key : "", //If needed but you sholuld make the dev user have access to the target server without pw or keys
user : "ubuntu",
host : ["slackops.rabidou.io"],
ref : "origin/master",
repo : "git@github.com:brabidou/SlackOps.git",
path : "/home/ubuntu/slackops",
// To prepare the host by installing required software (eg: git)
// even before the setup process starts
// can be multiple commands separated by the character ";"
// or path to a script on your local machine
"pre-setup" : "",
// Commands / path to a script on the host machine
// This will be executed on the host after cloning the repository
// eg: placing configurations in the shared dir etc
"post-setup": "ls -la",
// Commands to execute locally (on the same machine you deploy things)
// Can be multiple commands separated by the character ";"
"pre-deploy-local" : "echo 'This is a local executed command'",
// Commands to be executed on the server after the repo has been cloned
"post-deploy" : "npm install && pm2 startOrRestart ecosystem.config.js --env production",
// Environment variables that must be injected in all applications on this env
"env" : {
"NODE_ENV": "development"
}
},
}
};