improving docker updater
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 35s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 35s
This commit is contained in:
parent
d54cbdced3
commit
7b45d42daf
@ -58,6 +58,10 @@ fi
|
|||||||
for folder in */; do
|
for folder in */; do
|
||||||
cd $DOCKER_FOLDER/$folder
|
cd $DOCKER_FOLDER/$folder
|
||||||
|
|
||||||
|
# Remove trailing slash from folder name if it exists
|
||||||
|
folder=${folder%/}
|
||||||
|
echo -e "${LIGHT_BLUE}[$folder] Checking for updates..."
|
||||||
|
|
||||||
# if .ignore file exists, skip the folder
|
# if .ignore file exists, skip the folder
|
||||||
if [ -f ".ignore" ]; then
|
if [ -f ".ignore" ]; then
|
||||||
echo -e "${LIGHT_BLUE}[$folder] Skipping docker container update"
|
echo -e "${LIGHT_BLUE}[$folder] Skipping docker container update"
|
||||||
@ -65,17 +69,13 @@ for folder in */; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if docker-compose.yml or compose.yaml exists and remove the version attribute if it exists
|
# Check compose files for obsolete version attribute
|
||||||
if [ -f "docker-compose.yml" ]; then
|
for compose_file in "docker-compose.yml" "docker-compose.yaml" "compose.yaml" "compose.yml"; do
|
||||||
echo -e "${LIGHT_BLUE}[$folder] Checking docker-compose.yml for obsolete version attribute"
|
if [ -f "$compose_file" ]; then
|
||||||
sed -i '/^version:/d' docker-compose.yml
|
echo -e "${LIGHT_BLUE}[$folder] Checking $compose_file for obsolete version attribute"
|
||||||
elif [ -f "compose.yaml" ]; then
|
sed -i '/^version:/d' "$compose_file"
|
||||||
echo -e "${LIGHT_BLUE}[$folder] Checking compose.yaml for obsolete version attribute"
|
fi
|
||||||
sed -i '/^version:/d' compose.yaml
|
done
|
||||||
elif [ -f "compose.yml" ]; then
|
|
||||||
echo -e "${LIGHT_BLUE}[$folder] Checking compose.yml for obsolete version attribute"
|
|
||||||
sed -i '/^version:/d' compose.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
DOCKER_RUNNING=$(docker compose ps -q)
|
DOCKER_RUNNING=$(docker compose ps -q)
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ for folder in */; do
|
|||||||
|
|
||||||
echo -e "${LIGHT_GREEN}[$folder] Updated!"
|
echo -e "${LIGHT_GREEN}[$folder] Updated!"
|
||||||
|
|
||||||
cd ..
|
cd $DOCKER_FOLDER
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run Docker image prune
|
# Run Docker image prune
|
||||||
|
Loading…
x
Reference in New Issue
Block a user