Check for APP_KEY in every PHP Container
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-07-18 01:41:35 +02:00
parent 89a8feb278
commit ca0dd11336
1 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,11 @@ mkdir -p /app/storage/app/public || true
chown -R www-data:www-data /app/packages/laravel-nami/.cookies chown -R www-data:www-data /app/packages/laravel-nami/.cookies
chown -R www-data:www-data /app/storage/app chown -R www-data:www-data /app/storage/app
if [ $APP_KEY = "YOUR_APP_KEY" ]; then
echo "----------------------- Keinen APP KEY gefunden. Key wird generiert: $(su www-data -c 'php artisan key:generate --show') ----------------------- Füge diesen Key als APP_KEY ein ---------------------"
exit 1
fi
if [ $1 == "horizon" ]; then if [ $1 == "horizon" ]; then
wait_for_db wait_for_db
su www-data -c 'php artisan horizon' su www-data -c 'php artisan horizon'
@ -22,10 +27,6 @@ fi
if [ $1 == "app" ]; then if [ $1 == "app" ]; then
# --------------------------- ensure appkey is set ---------------------------- # --------------------------- ensure appkey is set ----------------------------
if [ $APP_KEY = "YOUR_APP_KEY" ]; then
echo "----------------------- Keinen APP KEY gefunden. Key wird generiert: $(su www-data -c 'php artisan key:generate --show') ----------------------- Füge diesen Key als APP_KEY ein ---------------------"
exit 1
fi
wait_for_db wait_for_db
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force
su www-data -c 'php artisan migrate --force' su www-data -c 'php artisan migrate --force'