Changes to mountpoint logic

This commit is contained in:
Deon George 2020-01-29 16:01:08 +11:00
parent 5943f0df5a
commit 584e56aceb

14
init
View File

@ -11,7 +11,7 @@ function mp() {
mountpoint -q $1 mountpoint -q $1
local mp=$? local mp=$?
set -e set -e
return ${mp} echo ${mp}
} }
# General Setup # General Setup
@ -27,8 +27,7 @@ if [ "${role}" = "app" -a -e artisan ]; then
exec /bin/bash exec /bin/bash
fi fi
mp ${php} mp=$(mp ${php})
mp=$?
# Only adjust perms if this is an external mountpoint # Only adjust perms if this is an external mountpoint
if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then
@ -53,8 +52,7 @@ if [ "${role}" = "app" -a -e artisan ]; then
NODEV="--no-dev" NODEV="--no-dev"
fi fi
mp ${php} mp=$(mp ${composer})
mp=$?
if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then if [ ${mp} -eq 0 -o -n "${FORCE_PERMS}" ] ; then
[ -n "${FORCE_PERMS}" -o "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chown -R www-data:www-data ${composer} [ -n "${FORCE_PERMS}" -o "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chown -R www-data:www-data ${composer}
@ -84,7 +82,8 @@ elif [ "$role" = "queue" -a -e artisan ]; then
fi fi
# We only check for non mount points, in case this container has the app inside # We only check for non mount points, in case this container has the app inside
if ! mp ${php}; then mp=$(mp ${php})
if [ ${mp} -eq 1 ]; then
echo "* Caching configuration..." echo "* Caching configuration..."
su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)" su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)"
fi fi
@ -106,7 +105,8 @@ elif [ "$role" = "scheduler" -a -e artisan ]; then
fi fi
# We only check for non mount points, in case this container has the app inside # We only check for non mount points, in case this container has the app inside
if ! mp ${php}; then mp=$(mp ${php})
if [ ${mp} -eq 1 ]; then
echo "* Caching configuration..." echo "* Caching configuration..."
su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)" su www-data -s /bin/sh -c "(php artisan config:cache && php artisan route:cache && php artisan view:cache)"
fi fi