mirror of
https://github.com/nextcloud/docker.git
synced 2025-04-21 03:06:08 +02:00
Add version.json
'versions.json' contains information about the latest branches and variants. It is managed by `./update.sh`, there's no need to edit this file manually, just run `./update.sh`. Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
parent
422a4a521c
commit
067ff5a871
2 changed files with 28 additions and 18 deletions
45
update.sh
45
update.sh
|
@ -112,6 +112,21 @@ function create_variant() {
|
||||||
|
|
||||||
echo "updating $fullversion [$1] $variant"
|
echo "updating $fullversion [$1] $variant"
|
||||||
|
|
||||||
|
# Apply version+variant-specific patches
|
||||||
|
case "$version" in
|
||||||
|
25)
|
||||||
|
case "$variant" in
|
||||||
|
fpm-alpine)
|
||||||
|
# Alpine 3.16 / OpenSSL 1.1 is only available for PHP 8.0
|
||||||
|
phpVersion=8.0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Nextcloud 26+ recommends sysvsem
|
||||||
|
sed -ri -e '/sysvsem/d' "$dir/Dockerfile"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Replace the variables.
|
# Replace the variables.
|
||||||
sed -ri -e '
|
sed -ri -e '
|
||||||
s/%%ALPINE_VERSION%%/'"$alpineVersion"'/g;
|
s/%%ALPINE_VERSION%%/'"$alpineVersion"'/g;
|
||||||
|
@ -130,24 +145,6 @@ function create_variant() {
|
||||||
s/%%CRONTAB_INT%%/'"$crontabInt"'/g;
|
s/%%CRONTAB_INT%%/'"$crontabInt"'/g;
|
||||||
' "$dir/Dockerfile"
|
' "$dir/Dockerfile"
|
||||||
|
|
||||||
# Nextcloud 26+ recommends sysvsem
|
|
||||||
case "$version" in
|
|
||||||
25 )
|
|
||||||
case "$variant" in
|
|
||||||
fpm-alpine )
|
|
||||||
# Alpine 3.16 / OpenSSL 1.1 is only available for PHP 8.0
|
|
||||||
sed -ri -e '
|
|
||||||
s/FROM php:8\.1-fpm-alpine/FROM php:8.0-fpm-alpine/
|
|
||||||
' "$dir/Dockerfile"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
sed -ri -e '
|
|
||||||
/sysvsem/d
|
|
||||||
' "$dir/Dockerfile"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Copy the shell scripts
|
# Copy the shell scripts
|
||||||
for name in entrypoint cron; do
|
for name in entrypoint cron; do
|
||||||
cp "docker-$name.sh" "$dir/$name.sh"
|
cp "docker-$name.sh" "$dir/$name.sh"
|
||||||
|
@ -163,6 +160,16 @@ function create_variant() {
|
||||||
if [ "$variant" != "apache" ]; then
|
if [ "$variant" != "apache" ]; then
|
||||||
rm "$dir/config/apache-pretty-urls.config.php"
|
rm "$dir/config/apache-pretty-urls.config.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add variant to versions.json
|
||||||
|
[ "${base[$variant]}" == "alpine" ] && baseVersion="$alpineVersion" || baseVersion="$debianVersion"
|
||||||
|
versionVariantsJson="$(jq -e \
|
||||||
|
--arg version "$version" --arg variant "$variant" --arg base "${base[$variant]}" --arg baseVersion "$baseVersion" --arg phpVersion "$phpVersion" \
|
||||||
|
'.[$version].variants[$variant] = {"variant": $variant, "base": $base, "baseVersion": $baseVersion, "phpVersion": $phpVersion}' versions.json)"
|
||||||
|
versionJson="$(jq -e \
|
||||||
|
--arg version "$version" --arg fullversion "$fullversion" --arg url "$url" --arg ascUrl "$ascUrl" --argjson variants "$versionVariantsJson" \
|
||||||
|
'.[$version] = {"branch": $version, "version": $fullversion, "url": $url, "ascUrl": $ascUrl, "variants": $variants[$version].variants}' versions.json)"
|
||||||
|
printf '%s\n' "$versionJson" > versions.json
|
||||||
}
|
}
|
||||||
|
|
||||||
curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
|
curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
|
||||||
|
@ -173,6 +180,8 @@ curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
|
||||||
|
|
||||||
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\|-alpha\)\?' -exec rm -r '{}' \;
|
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\|-alpha\)\?' -exec rm -r '{}' \;
|
||||||
|
|
||||||
|
printf '%s' "{}" > versions.json
|
||||||
|
|
||||||
fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
|
fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
|
||||||
grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \
|
grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \
|
||||||
grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' | \
|
grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' | \
|
||||||
|
|
1
versions.json
Normal file
1
versions.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
Loading…
Add table
Reference in a new issue