forked from fauxpilot/fauxpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.sh
executable file
·40 lines (36 loc) · 909 Bytes
/
launch.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
#!/usr/bin/env bash
# Read in .env file; error if not found
if [ ! -f .env ]; then
echo ".env not found, running setup.sh"
bash setup.sh
fi
source .env
function showhelp () {
# Display Help
echo
echo "Usage: $0 [option...]"
echo "options:"
echo " -h Print this help."
echo " -d Start in daemon mode."
echo
}
while getopts "hd" option; do
case $option in
h)
showhelp
exit;;
d)
options="-d"
;;
\?) # incorrect option
echo "Error: Invalid option"
exit;;
esac
done
# On versions above 20.10.2, docker-compose is docker compose
smaller=$(printf "$(docker --version | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')\n20.10.2" | sort -V | head -n1)
if [[ "$smaller" == "20.10.2" ]]; then
docker compose up $options --remove-orphans --build
else
docker-compose up $options --remove-orphans --build
fi;