Iterate on docker-stacks
This commit is contained in:
parent
894f473761
commit
a24fc0819a
@ -1,12 +1,9 @@
|
|||||||
# takes a docker-compose.yml file path and returns a boolean to represent
|
# takes a docker-compose.yml file path and returns a boolean to represent
|
||||||
# whether that stack depends on an smb share under the `/mnt/nas` path
|
# whether that stack depends on an smb share under the `/mnt/nas` path
|
||||||
function check_nas {
|
function check_nas {
|
||||||
STACK_PATH=$1
|
|
||||||
docker-compose config | grep -q /mnt/nas
|
docker-compose config | grep -q /mnt/nas
|
||||||
MATCH=$?
|
MATCH=$?
|
||||||
if [ $MATCH == 0]; then
|
if [ $MATCH != 0]; then
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
return false
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -80,10 +77,15 @@ function main {
|
|||||||
|
|
||||||
for stack in "$STACKS_DIRECTORY"/* ; do
|
for stack in "$STACKS_DIRECTORY"/* ; do
|
||||||
cd $stack
|
cd $stack
|
||||||
|
if [ $NAS_ONLY ]; then
|
||||||
|
if
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
up) echo "$COMMAND at $PWD" ;;
|
up) echo "$COMMAND at $PWD"
|
||||||
down) echo "$COMMAND at $PWD" ;;
|
;;
|
||||||
config) echo "$COMMAND at $PWD" ;;
|
down) echo "$COMMAND at $PWD"
|
||||||
|
;;
|
||||||
|
config) echo "$COMMAND at $PWD"
|
||||||
|
;;
|
||||||
*) echo "Unrecognized command '$COMMAND'" ;;
|
*) echo "Unrecognized command '$COMMAND'" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user