Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to force upgrades even when Nextcloud version did not change #2403

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 29/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 29/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 29/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 29/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 29/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 29/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 30/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 30/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 30/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 30/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 30/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
19 changes: 18 additions & 1 deletion 30/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
flock 9
fi

run_path pre-initialization

installed_version="0.0.0.0"
if [ -f /var/www/html/version.php ]; then
# shellcheck disable=SC2016
Expand All @@ -154,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
exit 1
fi

need_initialization=false

if version_greater "$image_version" "$installed_version"; then
need_initialization=true
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
echo Found /tmp/nextcloud-force-initialization, forcing initialization
need_initialization=true
fi

if [ "true" = "$need_initialization" ]; then
echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then
if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then
Expand Down Expand Up @@ -246,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi

run_path post-installation
fi
fi
fi
# not enough specified to do a fully automated installation
if [ "$install" = false ]; then
Expand All @@ -267,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
run_path post-upgrade
fi

if [ -f /tmp/nextcloud-force-initialization ]; then
rm /tmp/nextcloud-force-initialization
fi

echo "Initializing finished"
fi

Expand Down
3 changes: 2 additions & 1 deletion 31/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ RUN { \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
mkdir -p /docker-entrypoint-hooks.d/pre-initialization \
/docker-entrypoint-hooks.d/pre-installation \
/docker-entrypoint-hooks.d/post-installation \
/docker-entrypoint-hooks.d/pre-upgrade \
/docker-entrypoint-hooks.d/post-upgrade \
Expand Down
Loading