-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·45 lines (44 loc) · 1.33 KB
/
run.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
#!/bin/bash
if [ $# -eq 0 ]
then
PS3='Please enter your choice: '
options=("Mysql" "Mongo" "Elastic Search" "Kafka" "Postgres" "Redis")
select opt in "${options[@]}"
do
case $opt in
"Mysql")
docker-compose -f mysql/docker-compose.yml up -d
break
;;
"Mongo")
docker-compose -f kafka/docker-compose.yml up -d
break
;;
"Elastic Search")
docker-compose -f elasticsearch/docker-compose.yml up -d
break
;;
"Kafka")
docker-compose -f kafka/docker-compose.yml up -d
;;
"Postgres")
docker-compose -f postgres/docker-compose.yml up -d
;;
"Redis")
docker-compose -f redis/docker-compose.yml up -d
;;
"Druid")
docker-compose -f druid/docker-compose.yml up -d
;;
*) echo "invalid option $REPLY";;
esac
done
else
available=("mysql" "mongo" "kafka" "memcached" "postgres" "redis", "druid")
if printf '%s\n' "${available[@]}" | grep "^$1$"
then
docker-compose -f $1/docker-compose.yml up -d
else
echo "Couldn't find a service with name $1"
fi
fi