make the update more verbose for testing
This commit is contained in:
@@ -90,7 +90,7 @@ resolve_configured_php_bin() {
|
|||||||
read_setting_php_bin() {
|
read_setting_php_bin() {
|
||||||
if [[ ! -f artisan ]]; then
|
if [[ ! -f artisan ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
return
|
return 0
|
||||||
fi
|
fi
|
||||||
echo "Running with PHP binary: $PHP_BIN -r <read system.php_binary>" >&2
|
echo "Running with PHP binary: $PHP_BIN -r <read system.php_binary>" >&2
|
||||||
"$PHP_BIN" -r '
|
"$PHP_BIN" -r '
|
||||||
@@ -99,7 +99,7 @@ $app = require "bootstrap/app.php";
|
|||||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||||
$value = (string) \App\Models\Setting::where("key", "system.php_binary")->value("value");
|
$value = (string) \App\Models\Setting::where("key", "system.php_binary")->value("value");
|
||||||
echo trim($value);
|
echo trim($value);
|
||||||
' 2>/dev/null || true
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
PHP_BIN="$(resolve_php_bin)"
|
PHP_BIN="$(resolve_php_bin)"
|
||||||
@@ -119,7 +119,12 @@ fi
|
|||||||
echo "Running with PHP binary: $PHP_BIN $COMPOSER_BIN install --no-dev --optimize-autoloader"
|
echo "Running with PHP binary: $PHP_BIN $COMPOSER_BIN install --no-dev --optimize-autoloader"
|
||||||
"$PHP_BIN" "$COMPOSER_BIN" install --no-dev --optimize-autoloader
|
"$PHP_BIN" "$COMPOSER_BIN" install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
CONFIGURED_PHP="$(read_setting_php_bin)"
|
if ! CONFIGURED_PHP="$(read_setting_php_bin)"; then
|
||||||
|
echo "Failed to read configured PHP binary from settings." >&2
|
||||||
|
echo "Aborting to avoid running update with the wrong PHP binary." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Configured PHP binary from settings: ${CONFIGURED_PHP:-<empty>}"
|
||||||
PHP_BIN="$(resolve_configured_php_bin "$CONFIGURED_PHP" "$PHP_BIN")"
|
PHP_BIN="$(resolve_configured_php_bin "$CONFIGURED_PHP" "$PHP_BIN")"
|
||||||
|
|
||||||
echo "Final PHP binary: $PHP_BIN"
|
echo "Final PHP binary: $PHP_BIN"
|
||||||
|
|||||||
Reference in New Issue
Block a user