Skip permissions adjustments if dev mode or SKIP_PERM=1
This commit is contained in:
parent
c6f4d4835b
commit
528051fe04
21
init
21
init
@ -19,26 +19,29 @@ if [ "${role}" = "app" -a -e artisan ]; then
|
|||||||
exec /bin/bash
|
exec /bin/bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure our permissions are appropraite
|
if [ "${env}" != "dev" -a -z "${SKIP_PERM}" ]; then
|
||||||
find ${php} -type f -exec chmod 640 {} \;
|
echo "* Setting Permissions..."
|
||||||
find ${php} -type d -exec chmod 750 {} \;
|
# Make sure our permissions are appropraite
|
||||||
chown -R lamp:www-data ${php}
|
find ${php} -type f -exec chmod 640 {} \;
|
||||||
chown -R www-data:www-data ${php}/storage ${php}/bootstrap ${php}/composer.*
|
find ${php} -type d -exec chmod 750 {} \;
|
||||||
[ -e ${php}/vendor ] && chown -R www-data:www-data ${php}/vendor
|
chown -R lamp:www-data ${php}
|
||||||
|
chown -R www-data:www-data ${php}/storage ${php}/bootstrap ${php}/composer.*
|
||||||
|
[ -e ${php}/vendor ] && chown -R www-data:www-data ${php}/vendor
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${env}" != "local" -a -r "artisan" ]; then
|
if [ "${env}" != "local" -a -r "artisan" ]; then
|
||||||
# See if we need to refresh our dependancies
|
# See if we need to refresh our dependancies
|
||||||
if [[ -r composer.lock && ( -e .composer.refresh || ! -d vendor ) ]]; then
|
if [[ -r composer.lock && ( -e .composer.refresh || ! -d vendor ) ]]; then
|
||||||
rm -f ${php}/bootstrap/cache/*.php
|
rm -f ${php}/bootstrap/cache/*.php
|
||||||
chown -R www-data:www-data ${composer}
|
[ "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chown -R www-data:www-data ${composer}
|
||||||
[ ! -d ${php}/vendor ] && mkdir -m 750 ${php}/vendor && chown www-data:www-data ${php}/vendor
|
[ ! -d ${php}/vendor ] && mkdir -m 750 ${php}/vendor && chown www-data:www-data ${php}/vendor
|
||||||
if [ "${env}" != "dev" ]; then
|
if [ "${env}" != "dev" ]; then
|
||||||
NODEV="--no-dev"
|
NODEV="--no-dev"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod g+w ${php}
|
[ "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chmod g+w ${php}
|
||||||
su www-data -s /bin/sh -c "composer install --optimize-autoloader ${NODEV}" && ( test -e .composer.refresh && rm -f .composer.refresh )
|
su www-data -s /bin/sh -c "composer install --optimize-autoloader ${NODEV}" && ( test -e .composer.refresh && rm -f .composer.refresh )
|
||||||
chmod g-w ${php}
|
[ "${env}" != "dev" -a -z "${SKIP_PERM}" ] && chmod g-w ${php}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r .migrate ]; then
|
if [ -r .migrate ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user