develop #11

Merged
glenux merged 5 commits from develop into master 2024-07-20 15:00:20 +00:00
6 changed files with 62 additions and 15 deletions
Showing only changes of commit 8c88f074e0 - Show all commits

View file

@ -100,8 +100,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& mkdir /var/log/supervisord /var/run/supervisord && mkdir /var/log/supervisord /var/run/supervisord
COPY supervisord.conf /etc/supervisord.conf COPY supervisord.conf /etc/supervisord.conf
COPY --chmod=755 ./postdeploy.sh /app/postdeploy.sh COPY --chmod=755 ./hooks/gx.post-installation.www.sh /app/gx.post-installation.www.sh
COPY --chmod=755 ./postdeploy_hook.sh /docker-entrypoint-hooks.d/post-installation/postdeploy_hook.sh COPY --chmod=755 ./hooks/gx.post-installation.root.sh /docker-entrypoint-hooks.d/post-installation/gx.post-installation.root.sh
COPY --chmod=755 ./hooks/gx.before-starting.www.sh /app/gx.before-starting.www.sh
COPY --chmod=755 ./hooks/gx.before-starting.root.sh /docker-entrypoint-hooks.d/before-starting/gx.before-starting.root.sh
ENV NEXTCLOUD_UPDATE=1 ENV NEXTCLOUD_UPDATE=1

View file

@ -0,0 +1,7 @@
#!/bin/sh
set -u
set -e
echo "== Running post-installation hooks as root user =="
su -l -s /bin/sh www-data -c /app/gx.before-starting.www.sh

View file

@ -3,26 +3,29 @@
set -u set -u
set -e set -e
echo "== Running post-installation hooks as www user =="
# wait for nextcloud to be initialized
WORKDIR=/var/www/html WORKDIR=/var/www/html
counter=0 counter=0
while [ ! -d "$WORKDIR" ] && [ "$counter" -lt 120 ]; do while [ ! -d "$WORKDIR" ] && [ "$counter" -lt 120 ]; do
echo "GYR:POSTDEPLOY:WAITING" echo "GX:BEFORE-STARTING:WAITING"
counter=$((counter+1)) counter=$((counter+1))
sleep 1 sleep 1
done done
cd "$WORKDIR" || exit 1 cd "$WORKDIR" || exit 1
echo "GYR:POSTDEPLOY:START ($(pwd))" echo "GX:BEFORE-STARTING:START ($(pwd))"
find . -maxdepth 1 # find . -maxdepth 1
echo "GYR:POSTDEPLOY:UPGRADE" echo "GX:BEFORE-STARTING:UPGRADE"
php -d memory_limit=-1 occ upgrade php -d memory_limit=-1 occ upgrade
echo "GYR:POSTDEPLOY:DB" echo "GX:BEFORE-STARTING:DB"
php -d memory_limit=-1 occ db:convert-filecache-bigint php -d memory_limit=-1 occ db:convert-filecache-bigint
php -d memory_limit=-1 occ db:add-missing-indices php -d memory_limit=-1 occ db:add-missing-indices
echo "GYR:POSTDEPLOY:HTACCESS" echo "GX:BEFORE-STARTING:HTACCESS"
php -d memory_limit=-1 occ maintenance:update:htaccess php -d memory_limit=-1 occ maintenance:update:htaccess
echo "GYR:POSTDEPLOY:MAINTENANCE:OFF" echo "GX:BEFORE-STARTING:MAINTENANCE:OFF"
php -d memory_limit=-1 occ maintenance:mode --off php -d memory_limit=-1 occ maintenance:mode --off
php -d memory_limit=-1 occ maintenance:mode --off || true php -d memory_limit=-1 occ maintenance:mode --off || true
echo "GYR:POSTDEPLOY:END" echo "GX:BEFORE-STARTING:END"

View file

@ -0,0 +1,8 @@
#!/bin/sh
set -u
set -e
echo "== Running post-installation hooks as root user =="
su -l -s /bin/sh www-data -c /app/gx.post-installation.www.sh

View file

@ -0,0 +1,31 @@
#!/bin/sh
set -u
set -e
echo "== Running post-installation hooks as www user =="
# wait for nextcloud to be initialized
WORKDIR=/var/www/html
counter=0
while [ ! -d "$WORKDIR" ] && [ "$counter" -lt 120 ]; do
echo "GX:POST-INSTALLATION:WAITING"
counter=$((counter+1))
sleep 1
done
cd "$WORKDIR" || exit 1
echo "GX:POST-INSTALLATION:START ($(pwd))"
# # find . -maxdepth 1
# echo "GX:POST-INSTALLATION:UPGRADE"
# php -d memory_limit=-1 occ upgrade
# echo "GX:POST-INSTALLATION:DB"
# php -d memory_limit=-1 occ db:convert-filecache-bigint
# php -d memory_limit=-1 occ db:add-missing-indices
# echo "GX:POST-INSTALLATION:HTACCESS"
# php -d memory_limit=-1 occ maintenance:update:htaccess
# echo "GX:POST-INSTALLATION:MAINTENANCE:OFF"
# php -d memory_limit=-1 occ maintenance:mode --off
# php -d memory_limit=-1 occ maintenance:mode --off || true
echo "GX:POST-INSTALLATION:END"

View file

@ -1,5 +0,0 @@
#!/bin/sh
echo "Running postdeploy hooks as www-data"
su -l -s /bin/sh www-data -c /app/postdeploy.sh