fix(deploy): keep preview and build server hosts out of build --add-host

Preview containers (-pr-<id>) came and went with pull requests and
invalidated the build cache of every app on the network. A build server
got the IPs of the deployment server network, which it cannot reach.
Add a per-app setting to turn off network hosts during the build.

Closes #12452

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-11-05 23:34:53 +01:00
co-authored by Claude Opus 5.5
parent 5c34a1b3d4
commit e7e952fcad
10 changed files with 142 additions and 10 deletions
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if (! Schema::hasColumn('application_settings', 'include_network_hosts_in_build')) {
Schema::table('application_settings', function (Blueprint $table) {
$table->boolean('include_network_hosts_in_build')->default(true)->after('include_source_commit_in_build');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
if (Schema::hasColumn('application_settings', 'include_network_hosts_in_build')) {
Schema::table('application_settings', function (Blueprint $table) {
$table->dropColumn('include_network_hosts_in_build');
});
}
}
};