2023-02-24 16:05:47 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-02-24 16:10:42 +01:00
|
|
|
# evaluate options through given arguments
|
|
|
|
docker_root=
|
|
|
|
while [[ $# > 0 ]]; do
|
|
|
|
case $1 in
|
|
|
|
-d | --dir) docker_root=$2; shift 2;;
|
|
|
|
* ) break ;; # Anything else stops command line processing.
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ -z $docker_root ]]; then
|
|
|
|
docker_root=~/docker;
|
2023-02-24 16:05:47 +01:00
|
|
|
fi
|
|
|
|
|
2023-02-24 16:10:42 +01:00
|
|
|
for subdir in $docker_root/*; do
|
|
|
|
if [[ !(-d $subdir) ]]; then
|
2023-02-24 16:05:47 +01:00
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
cd $subdir;
|
|
|
|
docker-compose up -d;
|
|
|
|
done
|