prepare for cli updates with custom php binary
All checks were successful
CI/CD Pipeline / test (push) Successful in 2s
CI/CD Pipeline / deploy (push) Successful in 20s
CI/CD Pipeline / promote_stable (push) Successful in 3s

This commit is contained in:
2026-02-11 19:01:23 +01:00
parent 5cd8a1a9d6
commit ce3b89d54e
2 changed files with 15 additions and 7 deletions

View File

@@ -79,12 +79,20 @@ echo "Syncing version/build to settings..."
VERSION="$($PHP_BIN -r '$c=json_decode(file_get_contents("composer.json"), true); echo $c["version"] ?? "";')"
BUILD="$($PHP_BIN -r '$c=json_decode(file_get_contents("composer.json"), true); echo $c["build"] ?? "";')"
if [[ -n "$VERSION" ]]; then
$PHP_BIN artisan tinker --execute="\\App\\Models\\Setting::updateOrCreate(['key'=>'version'], ['value'=>'$VERSION']);"
fi
if [[ -n "$BUILD" ]]; then
$PHP_BIN artisan tinker --execute="\\App\\Models\\Setting::updateOrCreate(['key'=>'build'], ['value'=>'$BUILD']);"
if [[ -n "$VERSION" || -n "$BUILD" ]]; then
$PHP_BIN -r '
require "vendor/autoload.php";
$app = require "bootstrap/app.php";
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
if (getenv("SPEEDBB_VERSION")) {
\App\Models\Setting::updateOrCreate(["key" => "version"], ["value" => getenv("SPEEDBB_VERSION")]);
}
if (getenv("SPEEDBB_BUILD")) {
\App\Models\Setting::updateOrCreate(["key" => "build"], ["value" => getenv("SPEEDBB_BUILD")]);
}
' \
SPEEDBB_VERSION="$VERSION" \
SPEEDBB_BUILD="$BUILD"
fi
echo "Update complete."