Created
April 23, 2019 04:39
-
-
Save ezy/909a7483ced69f8d71890843200c33fa to your computer and use it in GitHub Desktop.
Shell script to run multiple docker-compose files in a microservices folder structure
This file contains hidden or 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
#!/usr/bin/env bash | |
directories=$(find . -mindepth 1 -maxdepth 1 -type d) | |
command="" | |
for d in $directories | |
do | |
file="$d/compose.yml" | |
if [ -f $file ]; | |
then | |
command="$command -f $file" | |
fi | |
done | |
command="docker-compose -f docker-compose.yml $command $@" | |
echo $command | |
eval $command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment