diff --git a/.github/workflows/renovate-app-version.sh b/.github/workflows/renovate-app-version.sh index 017b22e7..c9f74829 100644 --- a/.github/workflows/renovate-app-version.sh +++ b/.github/workflows/renovate-app-version.sh @@ -9,18 +9,28 @@ docker_compose_files=$(find apps/$app_name/$old_version -name docker-compose.yml for docker_compose_file in $docker_compose_files do - # Assuming that the app version will be from the first docker image - first_service=$(yq '.services | keys | .[0]' $docker_compose_file) + # Assuming that the app version will be from the first docker image + first_service=$(yq '.services | keys | .[0]' $docker_compose_file) - image=$(yq .services.$first_service.image $docker_compose_file) + image=$(yq .services.$first_service.image $docker_compose_file) - # Only apply changes if the format is : - if [[ "$image" == *":"* ]]; then - version=$(cut -d ":" -f2- <<< "$image") + # Only apply changes if the format is : + if [[ "$image" == *":"* ]]; then + version=$(cut -d ":" -f2- <<< "$image") - # Trim the "v" prefix - trimmed_version=${version/#"v"} + # Trim the "v" prefix + trimmed_version=${version/#"v"} - mv apps/$app_name/$old_version apps/$app_name/$trimmed_version + # Handle special versions with dates and other formats + if [[ "$trimmed_version" =~ ^[0-9]+(\.[0-9]+){0,3}$ ]]; then + # Extract the version part which can be 1 to 4 segments + trimmed_version=$(echo $trimmed_version | grep -oE '^[0-9]+(\.[0-9]+){0,4}') + elif [[ "$trimmed_version" =~ ^RELEASE\.[0-9]{4}-[0-9]{2}-[0-9]{2} ]]; then + # Handle minio version format RELEASE.YYYY-MM-DDTHH-MM-SSZ + trimmed_version=$(echo $trimmed_version | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}') + fi + + # Move to the new versioned directory + mv apps/$app_name/$old_version apps/$app_name/$trimmed_version fi done diff --git a/.github/workflows/renovate-app-version.sh.bac b/.github/workflows/renovate-app-version.sh.bac new file mode 100644 index 00000000..017b22e7 --- /dev/null +++ b/.github/workflows/renovate-app-version.sh.bac @@ -0,0 +1,26 @@ +#!/bin/bash +# This script copies the version from docker-compose.yml to config.json. + +app_name=$1 +old_version=$2 + +# find all docker-compose files under apps/$app_name (there should be only one) +docker_compose_files=$(find apps/$app_name/$old_version -name docker-compose.yml) + +for docker_compose_file in $docker_compose_files +do + # Assuming that the app version will be from the first docker image + first_service=$(yq '.services | keys | .[0]' $docker_compose_file) + + image=$(yq .services.$first_service.image $docker_compose_file) + + # Only apply changes if the format is : + if [[ "$image" == *":"* ]]; then + version=$(cut -d ":" -f2- <<< "$image") + + # Trim the "v" prefix + trimmed_version=${version/#"v"} + + mv apps/$app_name/$old_version apps/$app_name/$trimmed_version + fi +done diff --git a/apps/jellyfin/10.9.7/data.yml b/apps/jellyfin/10.9.8/data.yml similarity index 100% rename from apps/jellyfin/10.9.7/data.yml rename to apps/jellyfin/10.9.8/data.yml diff --git a/apps/jellyfin/10.9.7/docker-compose.yml b/apps/jellyfin/10.9.8/docker-compose.yml similarity index 96% rename from apps/jellyfin/10.9.7/docker-compose.yml rename to apps/jellyfin/10.9.8/docker-compose.yml index 644a9060..2314c155 100644 --- a/apps/jellyfin/10.9.7/docker-compose.yml +++ b/apps/jellyfin/10.9.8/docker-compose.yml @@ -6,7 +6,7 @@ networks: services: jellyfin: - image: jellyfin/jellyfin:10.9.7 + image: jellyfin/jellyfin:10.9.8 container_name: ${CONTAINER_NAME} labels: createdBy: "Apps" diff --git a/apps/jellyfin/10.9.7/scripts/init.sh b/apps/jellyfin/10.9.8/scripts/init.sh similarity index 100% rename from apps/jellyfin/10.9.7/scripts/init.sh rename to apps/jellyfin/10.9.8/scripts/init.sh diff --git a/apps/jellyfin/10.9.7/scripts/uninstall.sh b/apps/jellyfin/10.9.8/scripts/uninstall.sh similarity index 100% rename from apps/jellyfin/10.9.7/scripts/uninstall.sh rename to apps/jellyfin/10.9.8/scripts/uninstall.sh diff --git a/apps/jellyfin/10.9.7/scripts/upgrade.sh b/apps/jellyfin/10.9.8/scripts/upgrade.sh similarity index 100% rename from apps/jellyfin/10.9.7/scripts/upgrade.sh rename to apps/jellyfin/10.9.8/scripts/upgrade.sh