Skip to content

Instantly share code, notes, and snippets.

@TheMoroccan09
Last active November 28, 2017 11:02
Show Gist options
  • Save TheMoroccan09/00ec186066e4f10b513ae7c9277a268d to your computer and use it in GitHub Desktop.
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)
#!/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
@TheMoroccan09
Copy link
Author

TheMoroccan09 commented Sep 25, 2017

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment