mirror of
https://github.com/friendica/docker
synced 2025-01-01 10:35:21 +01:00
commit
07e973f4a9
48 changed files with 74 additions and 55 deletions
|
@ -3,9 +3,10 @@ set -eu
|
|||
|
||||
# copy of see .docker-files/entrypoint.sh - testing all versions
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
|
||||
if ! version_greater "2019.06" "2019.06-rc"; then
|
||||
exit 1;
|
||||
fi
|
||||
|
@ -33,3 +34,18 @@ fi
|
|||
if ! version_greater "2019.05" "2019.05-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-1" "2020.07"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-2" "2020.07-1"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-1" "2020.07-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.09-rc" "2020.09-dev"; then
|
||||
exit 1
|
||||
fi
|
||||
if version_greater "2020.06-rc" "2020.09-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
|
|
|
@ -132,8 +132,8 @@ RUN set -ex;\
|
|||
} > /etc/apache2/conf-available/remoteip.conf;\
|
||||
a2enconf remoteip
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.03
|
||||
ENV FRIENDICA_ADDONS 2020.03
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
|
@ -98,8 +98,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.03
|
||||
ENV FRIENDICA_ADDONS 2020.03
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
|
@ -123,8 +123,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.03
|
||||
ENV FRIENDICA_ADDONS 2020.03
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
|
@ -132,8 +132,8 @@ RUN set -ex;\
|
|||
} > /etc/apache2/conf-available/remoteip.conf;\
|
||||
a2enconf remoteip
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.07
|
||||
ENV FRIENDICA_ADDONS 2020.07
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -98,8 +98,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.07
|
||||
ENV FRIENDICA_ADDONS 2020.07
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -123,8 +123,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.07
|
||||
ENV FRIENDICA_ADDONS 2020.07
|
||||
ENV FRIENDICA_VERSION "2020.07-1"
|
||||
ENV FRIENDICA_ADDONS "2020.07-1"
|
||||
|
||||
RUN set -ex; \
|
||||
curl -fsSL -o friendica.tar.gz \
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -132,8 +132,8 @@ RUN set -ex;\
|
|||
} > /etc/apache2/conf-available/remoteip.conf;\
|
||||
a2enconf remoteip
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-dev
|
||||
ENV FRIENDICA_ADDONS 2020.09-dev
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -98,8 +98,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-dev
|
||||
ENV FRIENDICA_ADDONS 2020.09-dev
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -123,8 +123,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-dev
|
||||
ENV FRIENDICA_ADDONS 2020.09-dev
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -132,8 +132,8 @@ RUN set -ex;\
|
|||
} > /etc/apache2/conf-available/remoteip.conf;\
|
||||
a2enconf remoteip
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-rc
|
||||
ENV FRIENDICA_ADDONS 2020.09-rc
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -98,8 +98,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-rc
|
||||
ENV FRIENDICA_ADDONS 2020.09-rc
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -123,8 +123,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
|
||||
|
||||
ENV FRIENDICA_VERSION 2020.09-rc
|
||||
ENV FRIENDICA_ADDONS 2020.09-rc
|
||||
ENV FRIENDICA_VERSION ""
|
||||
ENV FRIENDICA_ADDONS ""
|
||||
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -97,8 +97,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
%%VARIANT_EXTRAS%%
|
||||
|
||||
ENV FRIENDICA_VERSION %%VERSION%%
|
||||
ENV FRIENDICA_ADDONS %%VERSION%%
|
||||
ENV FRIENDICA_VERSION "%%VERSION%%"
|
||||
ENV FRIENDICA_ADDONS "%%VERSION%%"
|
||||
%%INSTALL_EXTRAS%%
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -122,8 +122,8 @@ RUN set -ex; \
|
|||
VOLUME /var/www/html
|
||||
%%VARIANT_EXTRAS%%
|
||||
|
||||
ENV FRIENDICA_VERSION %%VERSION%%
|
||||
ENV FRIENDICA_ADDONS %%VERSION%%
|
||||
ENV FRIENDICA_VERSION "%%VERSION%%"
|
||||
ENV FRIENDICA_ADDONS "%%VERSION%%"
|
||||
%%INSTALL_EXTRAS%%
|
||||
|
||||
COPY *.sh upgrade.exclude /
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -1 +1 @@
|
|||
2020.07
|
||||
2020.07-1
|
||||
|
|
27
update.sh
27
update.sh
|
@ -92,13 +92,17 @@ variants=(
|
|||
fpm-alpine
|
||||
)
|
||||
|
||||
min_version='2020.03'
|
||||
min_version='2020.07-1'
|
||||
|
||||
# version_greater_or_equal A B returns whether A >= B
|
||||
function version_greater_or_equal() {
|
||||
[[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]];
|
||||
}
|
||||
|
||||
function get_hotfix_version() {
|
||||
printf '%s\n' "${fullversions[@]}" | grep -qE "^$( echo "$1" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' )"
|
||||
}
|
||||
|
||||
function create_variant() {
|
||||
dockerName=${1,,}
|
||||
dir="$dockerName/$variant"
|
||||
|
@ -122,7 +126,7 @@ function create_variant() {
|
|||
sed -ri -e '
|
||||
s/%%PHP_VERSION%%/'"${php_version[$version]-${php_version[default]}}"'/g;
|
||||
s/%%VARIANT%%/'"$variant"'/g;
|
||||
s/%%VERSION%%/'"$1"'/g;
|
||||
s/%%VERSION%%/'"$2"'/g;
|
||||
s/%%CMD%%/'"${cmd[$variant]}"'/g;
|
||||
s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g;
|
||||
s|%%INSTALL_EXTRAS%%|'"${install_extras[$install_type]}"'|g;
|
||||
|
@ -148,27 +152,26 @@ function create_variant() {
|
|||
}
|
||||
|
||||
curl -fsSL 'https://files.friendi.ca/' |tac|tac| \
|
||||
grep -oE 'friendica-full-[[:digit:]]+\.[[:digit:]]+' | \
|
||||
grep -oE '[[:digit:]]+\.[[:digit:]]+' | \
|
||||
grep -oE 'friendica-full-[[:digit:]]+\.[[:digit:]]+(\-[[:digit:]]+){0,1}' | \
|
||||
grep -oE '[[:digit:]]+\.[[:digit:]]+(\-[[:digit:]]+){0,1}' | \
|
||||
sort -uV | \
|
||||
tail -1 > latest.txt
|
||||
|
||||
curl -fsSl 'https://raw.githubusercontent.com/friendica/friendica/develop/VERSION' > develop.txt
|
||||
|
||||
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\(\.\|\-\)[[:digit:]]\+\(-rc\|-dev\)\?' -exec rm -r '{}' \;
|
||||
find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\(\.\|\-\)[[:digit:]]\+\(-rc\|-dev\|\-[[:digit:]]\)\?' -exec rm -r '{}' \;
|
||||
|
||||
fullversions=( $( curl -fsSL 'https://files.friendi.ca/' |tac|tac| \
|
||||
grep -oE 'friendica-full-[[:digit:]]+\.[[:digit:]]+' | \
|
||||
grep -oE '[[:digit:]]+\.[[:digit:]]+' | \
|
||||
grep -oE 'friendica-full-[[:digit:]]+\.[[:digit:]]+(\-[[:digit:]]+){0,1}' | \
|
||||
grep -oE '[[:digit:]]+\.[[:digit:]]+(\-[[:digit:]]+){0,1}' | \
|
||||
sort -urV ) )
|
||||
versions=( $( printf '%s\n' "${fullversions[@]}" | cut -d. -f1-2 | sort -urV ) )
|
||||
for version in "${versions[@]}"; do
|
||||
fullversion="$( printf '%s\n' "${fullversions[@]}" | grep -E "^$version" | head -1 )"
|
||||
for version in "${fullversions[@]}"; do
|
||||
fullversion="$( printf '%s\n' "${fullversions[@]}" | grep -E "^$version" | head -1 )"
|
||||
|
||||
if version_greater_or_equal "$version" "$min_version"; then
|
||||
if version_greater_or_equal "$fullversion" "$min_version"; then
|
||||
for variant in "${variants[@]}"; do
|
||||
|
||||
create_variant "$version"
|
||||
create_variant "$version" "$fullversion"
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue