-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathr.sh
executable file
·55 lines (46 loc) · 1.22 KB
/
r.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
46
47
48
49
50
51
52
53
54
55
if [ ! -d ./.vscode ]; then
mkdir -p ./.vscode;
fi
if [ ! -f ./.vscode/launch.json ]; then
cp -v ./hacks/vscode/launch.json ./.vscode/launch.json;
fi
if [ ! -f ./.vscode/settings.json ]; then
cp -v ./hacks/vscode/settings.json ./.vscode/settings.json;
fi
envfile=".env"
while getopts "e:" arg; do
case $arg in
e) envfile=$OPTARG;;
esac
done
skip_next=false
services=""
for arg in "$@"; do
if [ "$skip_next" = true ]; then
skip_next=false
continue
fi
if [ "$arg" = "-e" ]; then
skip_next=true
continue
fi
services="$services $arg"
done
if ! test -f "$envfile"; then
echo "File $envfile does not exist, exiting ..."
exit 1
fi
if docker compose > /dev/null 2>&1; then
compose_cmd="docker compose"
elif command -v docker-compose; then
compose_cmd="docker-compose"
else
echo "Error: Docker Compose is not installed. Please install it and try again."
exit 1
fi
version=$($compose_cmd version --short | cut -d "." -f 1)
if [ "$version" -lt 2 ]; then
echo "Docker Compose version is to low, needs to be v2.0.0 or higher."
exit 1
fi
$compose_cmd --env-file $envfile up openldap dex init-dex-db vault mongodb rabbitmq mongo-express redis ms-auth ms-kind $services