forked from cfpb/consumerfinance.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·36 lines (29 loc) · 836 Bytes
/
setup.sh
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
#!/bin/bash
# ==========================================================================
# Setup script for installing project dependencies.
# NOTE: Run this script while in the project root directory.
# It will not run correctly when run from another directory.
# ==========================================================================
# Set script to exit on any errors.
set -e
standalone() {
./frontend.sh $1
./backend.sh $1
if [[ ! -z "$CFGOV_SPEAK_TO_ME" ]]; then
say "Set up has finished."
fi
}
dockerized() {
./frontend.sh $2
ENVVAR=.env
if [ ! -f $ENVVAR ]; then
echo 'Creating default environment variables...'
cp "$ENVVAR"_SAMPLE $ENVVAR
fi
}
# Execute requested (or all) functions.
if [ "$1" == "docker" ]; then
dockerized
else
standalone $1
fi