mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-27 21:54:19 +01:00
multi-compose fix
Added a hacky fix for multi-compose containers, for example using overrides in custom directories or multiple override.yml
This commit is contained in:
parent
c50312dc83
commit
4ddb54770e
1 changed files with 7 additions and 3 deletions
10
dockcheck.sh
10
dockcheck.sh
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
VERSION="v0.2.0"
|
VERSION="v0.2.1"
|
||||||
Github="https://github.com/mag37/dockcheck"
|
Github="https://github.com/mag37/dockcheck"
|
||||||
|
|
||||||
### Check if there's a new release of the script:
|
### Check if there's a new release of the script:
|
||||||
|
|
@ -177,11 +177,15 @@ if [ -n "$GotUpdates" ] ; then
|
||||||
### cd to the compose-file directory to account for people who use relative volumes, eg - ${PWD}/data:data
|
### cd to the compose-file directory to account for people who use relative volumes, eg - ${PWD}/data:data
|
||||||
cd "$(dirname "${ComposeFile}")" || { echo "Path error - skipping $i" ; continue ; }
|
cd "$(dirname "${ComposeFile}")" || { echo "Path error - skipping $i" ; continue ; }
|
||||||
docker pull "$ContImage"
|
docker pull "$ContImage"
|
||||||
|
### Reformat for multi-compose:
|
||||||
|
IFS=',' read -r -a Confs <<< "$ContConfigFile" ; Unset IFS
|
||||||
|
for conf in "${Confs[@]}"; do CompleteConfs+="-f $conf " ; done
|
||||||
|
|
||||||
### Check if the container got an environment file set, use it if so:
|
### Check if the container got an environment file set, use it if so:
|
||||||
if [ -n "$ContEnv" ]; then
|
if [ -n "$ContEnv" ]; then
|
||||||
$DockerBin -f "$ComposeFile" --env-file "$ContEnv" up -d "$ContName"
|
$DockerBin ${CompleteConfs[@]} --env-file "$ContEnv" up -d "$ContName"
|
||||||
else
|
else
|
||||||
$DockerBin -f "$ComposeFile" up -d "$ContName"
|
$DockerBin ${CompleteConfs[@]} up -d "$ContName"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
printf "\033[0;32mAll done!\033[0m\n"
|
printf "\033[0;32mAll done!\033[0m\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue