diff options
author | Tilo Spannagel <development@tilosp.de> | 2017-06-10 23:15:01 +0200 |
---|---|---|
committer | Tilo Spannagel <development@tilosp.de> | 2017-06-10 23:15:11 +0200 |
commit | 86c40037bfbbf1ff8516ceb37825419668e50602 (patch) | |
tree | 0e68379816587458e0de48ff8a73b95ea8312f43 /update.sh | |
parent | 9b815390c8adfd2610069dbf5b5f05815b038ead (diff) |
Remove end of life versions
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 64 |
1 files changed, 35 insertions, 29 deletions
@@ -16,47 +16,53 @@ latests=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|t grep -oE '[[:digit:]]+(.[[:digit:]]+)+' | \ sort -uV ) ) +find -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+' -exec rm -r '{}' \; + travisEnv= for latest in "${latests[@]}"; do version=$(echo "$latest" | cut -d. -f1-2) - for variant in apache fpm; do - # Create the version+variant directory with a Dockerfile. - mkdir -p "$version/$variant" + # Only add versions >= 10 + if version_greater_or_equal "$version" "10.0"; then + + for variant in apache fpm; do + # Create the version+variant directory with a Dockerfile. + mkdir -p "$version/$variant" - template="Dockerfile.template" - if version_greater_or_equal "$version" "11.0"; then - template="Dockerfile-php7.template" - fi - cp "$template" "$version/$variant/Dockerfile" + template="Dockerfile.template" + if version_greater_or_equal "$version" "11.0"; then + template="Dockerfile-php7.template" + fi + cp "$template" "$version/$variant/Dockerfile" - echo "updating $latest [$version] $variant" + echo "updating $latest [$version] $variant" - # Replace the variables. - sed -ri -e ' - s/%%VARIANT%%/'"$variant"'/g; - s/%%VERSION%%/'"$latest"'/g; - s/%%CMD%%/'"${cmd[$variant]}"'/g; - ' "$version/$variant/Dockerfile" + # Replace the variables. + sed -ri -e ' + s/%%VARIANT%%/'"$variant"'/g; + s/%%VERSION%%/'"$latest"'/g; + s/%%CMD%%/'"${cmd[$variant]}"'/g; + ' "$version/$variant/Dockerfile" - # Remove Apache commands if we're not an Apache variant. - if [ "$variant" != "apache" ]; then - sed -ri -e '/a2enmod/d' "$version/$variant/Dockerfile" - fi + # Remove Apache commands if we're not an Apache variant. + if [ "$variant" != "apache" ]; then + sed -ri -e '/a2enmod/d' "$version/$variant/Dockerfile" + fi - # Remove the assets folder if version >= 10.0 - if version_greater_or_equal "$version" "10.0"; then - sed -ri -e '/assets/d' "$version/$variant/Dockerfile" - fi + # Remove the assets folder if version >= 10.0 + if version_greater_or_equal "$version" "10.0"; then + sed -ri -e '/assets/d' "$version/$variant/Dockerfile" + fi - # Copy the docker-entrypoint. - cp docker-entrypoint.sh "$version/$variant/docker-entrypoint.sh" + # Copy the docker-entrypoint. + cp docker-entrypoint.sh "$version/$variant/docker-entrypoint.sh" - # Copy apps.config.php - cp apps.config.php "$version/$variant/apps.config.php" + # Copy apps.config.php + cp apps.config.php "$version/$variant/apps.config.php" - travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv" - done + travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv" + done + fi done # update .travis.yml |