mirror of
https://github.com/nextcloud/docker.git
synced 2025-05-03 23:40:54 +02:00
Add ability to force reinitialization by putting a marker file in the tmp folder
We have a custom image where we'd like to recopy all of nextcloud's source code again when we update some internal thing without a change in Nextcloud's version. The newly added pre-initialization hook can be used to determine this and force a rerun. Signed-off-by: Stephan Brunner <s.brunner@stephan-brunner.net>
This commit is contained in:
parent
5bbbde3734
commit
d6b4877b36
11 changed files with 169 additions and 9 deletions
|
@ -156,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
|
||||
|
@ -248,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
|
||||
|
@ -269,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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue