Compare commits

..

7 Commits

Author SHA1 Message Date
mag37
1470055329 Merge pull request #62 from mag37/env-rework
Reworked --env-file logic.
2024-01-27 09:41:41 +01:00
mag37
904cd508d1 --env-file version bump 2024-01-27 09:39:37 +01:00
mag37
8ee1366505 typo 2024-01-26 21:53:15 +01:00
mag37
c063b09003 reworked --env-file logic 2024-01-26 20:45:32 +01:00
mag37
ea096b5dbc Merge pull request #58 from thomas-mc-work/patch-1
modified update notification
2024-01-24 22:17:37 +01:00
Thomas McWork
038a30b628 add colors to version update notice 2024-01-24 21:28:53 +01:00
Thomas McWork
24d82d74b3 modified update notification
Slightly changed the notation of the local/latest version to simplify the visual impression. But it's a matter of taste.
2024-01-24 21:22:49 +01:00
2 changed files with 11 additions and 7 deletions

View File

@@ -18,6 +18,7 @@
___ ___
## :bell: Changelog ## :bell: Changelog
- **v0.3.8**: Fixed `--env-file` logic to work with multiple env-files.
- **v0.3.7**: Added support for [labels](#bookmark-labels), added the `-f` option (force restart stack). - **v0.3.7**: Added support for [labels](#bookmark-labels), added the `-f` option (force restart stack).
- **v0.3.6**: Added pushbullet template. - **v0.3.6**: Added pushbullet template.
- **v0.3.5**: Added a simple progress bar for the registry checkup. - **v0.3.5**: Added a simple progress bar for the registry checkup.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERSION="v0.3.7" VERSION="v0.3.8"
### ChangeNotes: Added label support (see readme) and -f (force restart stack) option. ### ChangeNotes: Fixed --env-file logic to work with multiple env-files.
Github="https://github.com/mag37/dockcheck" Github="https://github.com/mag37/dockcheck"
RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh"
@@ -145,7 +145,7 @@ progress_bar() {
} }
### Version check & initiate self update ### Version check & initiate self update
[[ "$VERSION" != "$LatestRelease" ]] && { printf "New version available! Local: %s - Latest: %s \n Change Notes: %s \n" "$VERSION" "$LatestRelease" "$LatestChanges" ; [[ -z "$AutoUp" ]] && self_update_select ; } [[ "$VERSION" != "$LatestRelease" ]] && { printf "New version available! %b%s%b ⇒ %b%s%b \n Change Notes: %s \n" "$c_yellow" "$VERSION" "$c_reset" "$c_green" "$LatestRelease" "$c_reset" "$LatestChanges" ; [[ -z "$AutoUp" ]] && self_update_select ; }
### Set $1 to a variable for name filtering later. ### Set $1 to a variable for name filtering later.
SearchName="$1" SearchName="$1"
@@ -301,17 +301,20 @@ if [ -n "$GotUpdates" ] ; then
cd "$ContPath" || { echo "Path error - skipping $i" ; continue ; } cd "$ContPath" || { echo "Path error - skipping $i" ; continue ; }
printf "\n%bNow updating (%s/%s): %b%s%b\n" "$c_teal" "$CurrentQue" "$NumberofUpdates" "$c_blue" "$i" "$c_reset" printf "\n%bNow updating (%s/%s): %b%s%b\n" "$c_teal" "$CurrentQue" "$NumberofUpdates" "$c_blue" "$i" "$c_reset"
### Checking if Label Only -option is set, and if container got the label ### Checking if Label Only -option is set, and if container got the label
[[ "$OnlyLabel" == true ]] && { [[ "$ContUpdateLabel" != true ]] && { echo "No label, skipping" ; continue ; } } [[ "$OnlyLabel" == true ]] && { [[ "$ContUpdateLabel" != true ]] && { echo "No update label, skipping." ; continue ; } }
docker pull "$ContImage" docker pull "$ContImage"
### Reformat for multi-compose: ### Reformat for multi-compose:
IFS=',' read -r -a Confs <<< "$ComposeFile" ; unset IFS IFS=',' read -r -a Confs <<< "$ComposeFile" ; unset IFS
for conf in "${Confs[@]}"; do CompleteConfs+="-f $conf " ; done 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 # also checking if stack should be restarted if [ -n "$ContEnv" ]; then
### prepare env-files arguments
ContEnvs=$(for env in ${ContEnv//,/ } ; do printf -- "--env-file %s " $env; done)
### Check if the whole stack should be restarted
if [[ "$ContRestartStack" == true ]] || [[ "$ForceRestartStacks" == true ]] ; then if [[ "$ContRestartStack" == true ]] || [[ "$ForceRestartStacks" == true ]] ; then
$DockerBin ${CompleteConfs[@]} stop ; $DockerBin ${CompleteConfs[@]} --env-file "$ContEnv" up -d $DockerBin ${CompleteConfs[@]} stop ; $DockerBin ${CompleteConfs[@]} ${ContEnvs} up -d
else else
$DockerBin ${CompleteConfs[@]} --env-file "$ContEnv" up -d "$ContName" # unquoted array to allow split - rework? $DockerBin ${CompleteConfs[@]} ${ContEnvs} up -d "$ContName" # unquoted array to allow split - rework?
fi fi
else else
if [[ "$ContRestartStack" == true ]] || [[ "$ForceRestartStacks" == true ]] ; then if [[ "$ContRestartStack" == true ]] || [[ "$ForceRestartStacks" == true ]] ; then