Iterate on docker-stacks
This commit is contained in:
parent
a24fc0819a
commit
438e60c979
@ -1,10 +1,11 @@
|
|||||||
# 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 {
|
||||||
docker-compose config | grep -q /mnt/nas
|
if [ docker-compose config | grep -q /mnt/nas ]; then
|
||||||
|
docker-compose config | grep -q /mnt/nas # this returns 0 if `/mnt/nas` is present in the config
|
||||||
MATCH=$?
|
MATCH=$?
|
||||||
if [ $MATCH != 0]; then
|
if [ $MATCH == 0]; then
|
||||||
return false
|
return true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,8 +78,17 @@ function main {
|
|||||||
|
|
||||||
for stack in "$STACKS_DIRECTORY"/* ; do
|
for stack in "$STACKS_DIRECTORY"/* ; do
|
||||||
cd $stack
|
cd $stack
|
||||||
|
if [ $NAS_ONLY ] || [ $LINT ]; then
|
||||||
|
TMP=$(docker-compose config)
|
||||||
|
PASS=$?
|
||||||
if [ $NAS_ONLY ]; then
|
if [ $NAS_ONLY ]; then
|
||||||
if
|
echo $TMP | grep -q /mnt/nas
|
||||||
|
NAS_DEPENDENT=$?
|
||||||
|
if [ $NAS_DEPENDENT ]; then
|
||||||
|
echo "\$NAS_DEPENDENT is $NAS_DEPENDENT for $stack"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
up) echo "$COMMAND at $PWD"
|
up) echo "$COMMAND at $PWD"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user