-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathstart.sh
executable file
·45 lines (40 loc) · 1.49 KB
/
start.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
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
#########################
# Setup scripts-common
# repo: https://gitlab.com/bertrand-benoit/scripts-common
#########################
currentDir="$( dirname "$( command -v "$0" )" )"
scriptsCommonUtilities="$( dirname "$currentDir" )/scripts-common/utilities.sh"
[ ! -f "$scriptsCommonUtilities" ] && echo -e "ERROR: scripts-common utilities not found, you must install it before using this script (checked path: $scriptsCommonUtilities)" >&2 && exit 1
# shellcheck disable=1090
. "$scriptsCommonUtilities"
BSC_VERBOSE=1
BSC_CATEGORY="DeepDream Maker"
#########################
# The command line help #
#########################
display_help() {
warning "Invalid option"
info "Usage: $(basename "$0") [option...] {prod|dev}"
exit 1
}
if (( $# == 0 )); then
# no parameters given, run production
DOCKERFILE=docker-compose.prod.yml
elif [ "$1" == "dev" ]; then
# run development env only if specified
DOCKERFILE=docker-compose.yml
elif [ "$1" == "prod" ]; then
# run run production
DOCKERFILE=docker-compose.yml
else
display_help
exit 0
fi
# Check if docker and docker compose are installed
BSC_MODE_CHECK_CONFIG=1
checkBin docker || errorMessage "This tool requires Docker. Install it please, and then run this tool again."
checkBin docker-compose || errorMessage "This tool requires Docker compose. Install it please, and then run this tool again."
BSC_MODE_CHECK_CONFIG=0
#docker-compose -f ${DOCKERFILE} --build
docker-compose -f "${DOCKERFILE}" up --build