dudi/deploy.sh
Simon Kühn 6503466344 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>
2026-04-29 20:39:27 +02:00

19 lines
628 B
Bash
Executable file

#!/bin/bash
# Auf miniweb ausführen: bash /var/www/tracker/deploy.sh
set -e
cd "$(dirname "$0")"
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
$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."