File tree Expand file tree Collapse file tree 11 files changed +169
-9
lines changed
Expand file tree Collapse file tree 11 files changed +169
-9
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -156,7 +156,18 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
156156 exit 1
157157 fi
158158
159+ need_initialization=false
160+
159161 if version_greater " $image_version " " $installed_version " ; then
162+ need_initialization=true
163+ fi
164+
165+ if [ -f /tmp/nextcloud-force-initialization ]; then
166+ echo Found /tmp/nextcloud-force-initialization, forcing initialization
167+ need_initialization=true
168+ fi
169+
170+ if [ " true" = " $need_initialization " ]; then
160171 echo " Initializing nextcloud $image_version ..."
161172 if [ " $installed_version " != " 0.0.0.0" ]; then
162173 if [ " ${image_version%% .* } " -gt " $(( ${installed_version%% .* } + 1 )) " ]; then
@@ -248,7 +259,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
248259 fi
249260
250261 run_path post-installation
251- fi
262+ fi
252263 fi
253264 # not enough specified to do a fully automated installation
254265 if [ " $install " = false ]; then
@@ -269,6 +280,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
269280 run_path post-upgrade
270281 fi
271282
283+ if [ -f /tmp/nextcloud-force-initialization ]; then
284+ rm /tmp/nextcloud-force-initialization
285+ fi
286+
272287 echo " Initializing finished"
273288 fi
274289
Original file line number Diff line number Diff line change @@ -393,6 +393,16 @@ To use the hooks triggered by the `entrypoint` script, either
393393...
394394```
395395
396+ ## Forcing an upgrade run
397+
398+ Sometimes you need to force an explicit upgrade run even when the bundled Nextcloud version did not change.
399+ An example would be when you have custom apps bundled and you want to update those.
400+
401+ To do this, you can simply create a file ` /tmp/nextcloud-force-initialization ` before the need for an upgrade is determined.
402+ The content is irrelevant.
403+ You can either create this file before starting the container, or you can use the ` pre-initialization ` hook to create it.
404+ After the update has successfully run, the file is removed automatically.
405+
396406# Running this image with ` docker compose `
397407The easiest way to get a fully featured and functional setup is using a ` compose.yaml ` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for.
398408
You can’t perform that action at this time.
0 commit comments