forked from PTFS-Europe/ems-email
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a new property to the instance config which allows a cron schedule to be specified for the script. It also moves the encryption key under which user emails are stored into something that is pasted in when the app starts. - Add cron_restart property to ecosystem.config.js.template - Remove KEY property from app environment in ecosystem.config.js.template - Create start.sh, a script that accepts arguments containing the instance name and environment, then prompts the user to paste the encryption key, then starts the app, passing the key into the app's environment.
- Loading branch information
Andrew Isherwood
committed
Nov 4, 2020
1 parent
74aeb12
commit 907812b
Showing
2 changed files
with
38 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
while getopts ":i:e:" opt; do | ||
case $opt in | ||
i) instance="$OPTARG" | ||
;; | ||
e) env="$OPTARG" | ||
;; | ||
\?) echo "Invalid option -$OPTARG" >&2 | ||
exit | ||
;; | ||
esac | ||
done | ||
|
||
INST_LEN=$(echo -n $instance | wc -m) | ||
ENV_LEN=$(echo -n $env | wc -m) | ||
|
||
if [[ $INST_LEN == 0 || $ENV_LEN == 0 ]] | ||
then | ||
echo "Invalid parameters passed, must pass -i <instance_name> -e <environment>" | ||
exit | ||
fi | ||
|
||
echo Paste key, then press enter | ||
|
||
read key | ||
|
||
KEY_LEN=$(echo -n $key | wc -m) | ||
|
||
if [[ $KEY_LEN = 0 ]] | ||
then | ||
echo "Invalid key passed" | ||
fi | ||
|
||
KEY=$key pm2 start --only $instance --env $env |