-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
206 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
sudo: false | ||
language: node_js | ||
branches: | ||
only: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apps: | ||
- name: test | ||
script: examples/echo.js | ||
- name: HTTP | ||
script: examples/child.js | ||
instances: 4 | ||
- name: PythonApp | ||
script: examples/echo.py | ||
interpreter: /usr/bin/python3 | ||
interpreter_args: -u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
SRC=$(cd $(dirname "$0"); pwd) | ||
source "${SRC}/include.sh" | ||
cd $file_path/yaml-configuration | ||
|
||
$pm2 start non-existent.yaml | ||
should 'should have started 0 processes because file unknown' 'online' 0 | ||
|
||
$pm2 start malformated.yml | ||
should 'should have started 0 processes because file malformated' 'online' 0 | ||
|
||
$pm2 start apps.yaml | ||
should 'should have started 6 processes' 'online' 6 | ||
|
||
$pm2 restart all | ||
should 'should have restarted 6 processes' 'restart_time: 1' 6 | ||
|
||
$pm2 restart apps.yaml | ||
should 'should have restarted 6 processes' 'restart_time: 2' 6 | ||
|
||
$pm2 reload all | ||
should 'should have reloaded 6 processes' 'restart_time: 3' 6 | ||
|
||
$pm2 reload apps.yaml | ||
should 'should have reloaded 6 processes' 'restart_time: 4' 6 | ||
|
||
$pm2 stop all | ||
should 'should have reloaded 6 processes' 'stopped' 6 | ||
|
||
$pm2 start apps.yaml | ||
$pm2 delete all | ||
should 'should have deleted 6 processes' 'online' 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apps: | ||
- name: test | ||
script: echo.js | ||
- name: HTTP | ||
script: child.js | ||
instances: 4 | ||
- name: PythonApp | ||
script: echo.py | ||
interpreter: /usr/bin/python3 | ||
interpreter_args: -u | ||
env: | ||
DEFAULT_STR: 'PYTHONENV' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apps: | ||
- name: test | ||
script: echo.js | ||
- name: HTTP | ||
script: child.js | ||
instances: 4 | ||
- name: PythonApp | ||
script: echo.py | ||
interpreter: /usr/bin/python3 | ||
interpreter_args: -u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
|
||
|
||
var http = require('http'); | ||
|
||
http.createServer(function(req, res) { | ||
res.writeHead(200); | ||
res.end('hey'); | ||
}).listen(8000); | ||
|
||
process.on('message', function(msg) { | ||
if (msg == 'shutdown') { | ||
console.log('Closing all connections...'); | ||
setTimeout(function() { | ||
console.log('Finished closing connections'); | ||
process.exit(0); | ||
}, 100); | ||
} | ||
}); |
Oops, something went wrong.