#!/bin/bash set -e # Start PHP-FPM PHP_FPM=$(find /usr/sbin -name 'php-fpm*' | head -1) $PHP_FPM # deploy.php laeuft als www-data, das Repo gehoert einem anderen Benutzer. # Ohne diese Ausnahme bricht git mit "detected dubious ownership" ab und die # &&-Kette in deploy.php erreicht hugo nie. --system gilt fuer alle Benutzer. git config --system --add safe.directory /var/www/html git config --system --add safe.directory /var/www/html/themes/gokarna # www-data muss ins Repo schreiben koennen (git pull, hugo nach public/). chown -R www-data:www-data /var/www/html || true # Initial Hugo build cd /var/www/html git submodule update --init --recursive hugo # Start nginx in foreground nginx -g 'daemon off;'