-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pm2 * Add pm2 for local dev * Refactor start-fullstack commands to use pm2 * Minor: rename fn for clarity The fn is used for frontends as well, doesnt make sense having server in the name * Use start-stack instead of start-fullstack * Add start-stack at root level for ergonomics Running `yarn start-stack x` is nicer than `yarn package:start-stack x`
- Loading branch information
Showing
15 changed files
with
971 additions
and
74 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
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,17 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const { startDevConfigs } = require("./base.config"); | ||
|
||
module.exports = { | ||
apps: startDevConfigs([ | ||
"central-server", | ||
"entity-server", | ||
"report-server", | ||
"data-table-server", | ||
"admin-panel-server", | ||
"admin-panel", | ||
]) | ||
}; |
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,31 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const baseConfig = { | ||
"error_file" : null, | ||
"out_file" : null, | ||
"wait_ready" : false, // don't wait for one process to finish starting before starting next | ||
} | ||
|
||
/** | ||
* Convenience fn | ||
*/ | ||
const startDevConfig = (packageName) => ({ | ||
"name" : packageName, | ||
"script" : `yarn workspace @tupaia/${packageName} start-dev`, | ||
...baseConfig, | ||
}); | ||
|
||
/** | ||
* Convenience fn | ||
*/ | ||
const startDevConfigs = (packageNames) => | ||
packageNames.map(packageName => startDevConfig(packageName)); | ||
|
||
module.exports = { | ||
baseConfig: baseConfig, | ||
startDevConfig, | ||
startDevConfigs, | ||
} |
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,16 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const { startDevConfigs } = require("./base.config"); | ||
|
||
module.exports = { | ||
apps: startDevConfigs([ | ||
"central-server", | ||
"entity-server", | ||
"report-server", | ||
"datatrak-web-server", | ||
"datatrak-web", | ||
]) | ||
}; |
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,16 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const { startDevConfigs } = require("./base.config"); | ||
|
||
module.exports = { | ||
apps: startDevConfigs([ | ||
"central-server", | ||
"entity-server", | ||
"report-server", | ||
"lesmis-server", | ||
"lesmis", | ||
]) | ||
}; |
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,17 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const { startDevConfigs } = require("./base.config"); | ||
|
||
module.exports = { | ||
apps: startDevConfigs([ | ||
"central-server", | ||
"entity-server", | ||
"report-server", | ||
"data-table-server", | ||
"psss-server", | ||
"psss", | ||
]) | ||
}; |
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,18 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
const { startDevConfigs } = require("./base.config"); | ||
|
||
module.exports = { | ||
apps: startDevConfigs([ | ||
"central-server", | ||
"entity-server", | ||
"report-server", | ||
"web-config-server", | ||
"data-table-server", | ||
"tupaia-web-server", | ||
"tupaia-web", | ||
]) | ||
}; |
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,23 @@ | ||
#!/bin/bash -e | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: yarn start-dev <stack>" | ||
echo "" | ||
echo "All stacks:" | ||
ls -1 ../../packages/devops/configs/pm2/ | sed 's|.config.js||g' | grep -v 'base' | awk '$0=" "$0' | ||
echo "" | ||
echo "Tips:" | ||
echo " - normal pm2 commands work e.g. yarn pm2 status" | ||
echo " - start multiple stacks by calling this cmd multiple times" | ||
exit 1 | ||
fi | ||
|
||
yarn pm2 start "../../packages/devops/configs/pm2/$1.config.js" | ||
|
||
# When user quits logs stop everything | ||
trap "echo Stopping... && yarn pm2 delete all" EXIT | ||
|
||
yarn pm2 logs --lines 0 |
Oops, something went wrong.