fix modal, add env variables, etc
This commit is contained in:
@@ -39,8 +39,6 @@ return new class extends Migration
|
||||
$table->string('base_directory')->default('/');
|
||||
$table->string('publish_directory')->nullable();
|
||||
|
||||
$table->schemalessAttributes('environment_variables');
|
||||
|
||||
$table->string('health_check_path')->default('/');
|
||||
$table->string('health_check_port')->nullable();
|
||||
$table->string('health_check_host')->default('localhost');
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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
|
||||
{
|
||||
Schema::create('environment_variables', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('key');
|
||||
$table->string('value')->nullable();
|
||||
$table->boolean('is_build_time')->default(false);
|
||||
|
||||
$table->foreignId('application_id')->nullable();
|
||||
$table->foreignId('service_id')->nullable();
|
||||
$table->foreignId('database_id')->nullable();
|
||||
|
||||
$table->unique(['key', 'application_id', 'is_build_time']);
|
||||
$table->unique(['key', 'service_id', 'is_build_time']);
|
||||
$table->unique(['key', 'database_id', 'is_build_time']);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('environment_variables');
|
||||
}
|
||||
};
|
||||
@@ -35,16 +35,6 @@ class ApplicationSeeder extends Seeder
|
||||
'destination_type' => StandaloneDocker::class,
|
||||
'source_id' => $github_public_source->id,
|
||||
'source_type' => GithubApp::class,
|
||||
'environment_variables' => [
|
||||
'NODE_ENV' => [
|
||||
'value' => 'production',
|
||||
'isBuildOnly' => true,
|
||||
],
|
||||
'PORT' => [
|
||||
'value' => 3000,
|
||||
'isBuildOnly' => false,
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Environment;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
@@ -27,6 +28,7 @@ class DatabaseSeeder extends Seeder
|
||||
ApplicationSettingsSeeder::class,
|
||||
DBSeeder::class,
|
||||
ServiceSeeder::class,
|
||||
EnvironmentVariableSeeder::class,
|
||||
LocalPersistentVolumeSeeder::class,
|
||||
]);
|
||||
}
|
||||
|
||||
22
database/seeders/EnvironmentVariableSeeder.php
Normal file
22
database/seeders/EnvironmentVariableSeeder.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\EnvironmentVariable;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class EnvironmentVariableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
EnvironmentVariable::create([
|
||||
'key' => 'NODE_ENV',
|
||||
'value' => 'production',
|
||||
'is_build_time' => true,
|
||||
'application_id' => 1,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user