Add support for betas to update.sh
Signed-off-by: Tilo Spannagel <development@tilosp.de>
This commit is contained in:
parent
c7092b7a93
commit
ffa7769319
27
update.sh
27
update.sh
@ -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/-/ /}')"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user