Last active
November 28, 2017 11:02
-
-
Save TheMoroccan09/00ec186066e4f10b513ae7c9277a268d to your computer and use it in GitHub Desktop.
To launch many docker-compose.yml file that each one is in a specific folder (docker >= v2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#TODO Delete proxy when user choise all | |
container_name="???" | |
red=`tput setaf 1` | |
cyan=`tput setaf 6` | |
reset=`tput sgr0` | |
CONTAINERS_FOLDER="$HOME/containers" | |
CHOICES=('shared' 'geocoding' 'jptrack' 'fm' 'kpi' 'gm') | |
while [ $container_name != 'exit' ] | |
do | |
read -p 'Enter the container name or (exit): ' container_name | |
if [[ ${CHOICES[@]} =~ $container_name ]] | |
then | |
docker-compose -f "$CONTAINERS_FOLDER/$container_name/docker-compose.yml" up -d | |
elif [[ $container_name = 'all' ]] | |
then | |
for el in ${CHOICES[@]} | |
do | |
docker-compose -f "$CONTAINERS_FOLDER/$el/docker-compose.yml" up -d | |
done | |
echo "${cyan}See you soon :d! ${reset}" | |
elif [[ $container_name = 'exit' ]] | |
then | |
echo "${cyan}See you soon :d! ${reset}" | |
else | |
echo "${red}$container_name doesn't exist ${reset}" | |
fi | |
done |
Author
TheMoroccan09
commented
Sep 25, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment