0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-11-18 02:56:42 +01:00

Add support for betas to update.sh

Signed-off-by: Tilo Spannagel <development@tilosp.de>
This commit is contained in:
Tilo Spannagel 2018-07-26 18:12:44 +02:00
parent c7092b7a93
commit ffa7769319

View file

@ -47,6 +47,11 @@ function check_released() {
printf '%s\n' "${fullversions[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )"
}
# checks if the the beta has already a rc
function check_rc_released() {
printf '%s\n' "${fullversions_rc[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )"
}
travisEnv=
function create_variant() {
@ -92,7 +97,7 @@ function create_variant() {
done
}
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\)\?' -exec rm -r '{}' \;
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\)\?' -exec rm -r '{}' \;
fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \
@ -131,6 +136,26 @@ for version in "${versions_rc[@]}"; do
fi
done
fullversions_beta=( $( curl -fsSL 'https://download.nextcloud.com/server/prereleases/' |tac|tac| \
grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}beta[[:digit:]]+' | \
grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}beta[[:digit:]]+' | \
sort -urV ) )
versions_rc=( $( printf '%s\n' "${fullversions_beta[@]}" | cut -d. -f1-2 | sort -urV ) )
for version in "${versions_rc[@]}"; do
fullversion="$( printf '%s\n' "${fullversions_beta[@]}" | grep -E "^$version" | head -1 )"
if version_greater_or_equal "$version" "$min_version"; then
if ! check_rc_released "$fullversion"; then
for variant in "${variants[@]}"; do
create_variant "$version-beta" "https:\/\/download.nextcloud.com\/server\/prereleases"
done
fi
fi
done
# replace the fist '-' with ' '
travisEnv="$(echo "$travisEnv" | sed '0,/-/{s/-/ /}')"