Run deploy commands as www-data for correct file ownership
SSH key copied to /var/www/.ssh/ for www-data GitHub access. All git, composer, and console commands now run as www-data so var/cache/ files are always owned correctly without a manual chown. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d7edb30998
commit
6503466344
1 changed files with 7 additions and 5 deletions
12
deploy.sh
12
deploy.sh
|
|
@ -4,14 +4,16 @@ set -e
|
|||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
git pull
|
||||
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --no-interaction --optimize-autoloader --ignore-platform-reqs
|
||||
RUN="su -s /bin/sh www-data -c"
|
||||
|
||||
$RUN "git pull"
|
||||
$RUN "COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --no-interaction --optimize-autoloader --ignore-platform-reqs"
|
||||
|
||||
# Alias-Deployment: RewriteBase auf /dd/ setzen
|
||||
sed -i 's|RewriteBase /$|RewriteBase /dd/|' public/.htaccess
|
||||
|
||||
APP_ENV=prod php bin/console doctrine:migrations:migrate --no-interaction --env=prod
|
||||
APP_ENV=prod php bin/console cache:clear --env=prod --no-warmup
|
||||
chown -R www-data:www-data var/
|
||||
$RUN "APP_ENV=prod php bin/console doctrine:migrations:migrate --no-interaction --env=prod"
|
||||
$RUN "APP_ENV=prod php bin/console cache:clear --env=prod --no-warmup"
|
||||
$RUN "APP_ENV=prod php bin/console cache:warmup --env=prod"
|
||||
|
||||
echo "Deploy fertig."
|
||||
|
|
|
|||
Loading…
Reference in a new issue