wip
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\ApplicationSetting;
|
||||
use App\Models\Environment;
|
||||
use App\Models\GithubApp;
|
||||
use App\Models\StandaloneDocker;
|
||||
@@ -24,20 +25,25 @@ class ApplicationSeeder extends Seeder
|
||||
Application::create([
|
||||
'id' => 1,
|
||||
'name' => 'My first application',
|
||||
'git_repository' => 'coollabsio/coolify-examples',
|
||||
'git_branch' => 'nodejs-fastify',
|
||||
'build_pack' => 'nixpacks',
|
||||
'ports_exposes' => '3000',
|
||||
'ports_mappings' => '3000:3000,3010:3001',
|
||||
'environment_id' => $environment_1->id,
|
||||
'destination_id' => $standalone_docker_1->id,
|
||||
'destination_type' => StandaloneDocker::class,
|
||||
'source_id' => $github_public_source->id,
|
||||
'source_type' => GithubApp::class,
|
||||
]);
|
||||
Application::create([
|
||||
'id' => 2,
|
||||
'name' => 'My second application (Swarm)',
|
||||
'environment_id' => $environment_1->id,
|
||||
'destination_id' => $swarm_docker_1->id,
|
||||
'destination_type' => SwarmDocker::class,
|
||||
'source_id' => $github_public_source->id,
|
||||
'source_type' => GithubApp::class,
|
||||
]);
|
||||
// Application::create([
|
||||
// 'id' => 2,
|
||||
// 'name' => 'My second application (Swarm)',
|
||||
// 'environment_id' => $environment_1->id,
|
||||
// 'destination_id' => $swarm_docker_1->id,
|
||||
// 'destination_type' => SwarmDocker::class,
|
||||
// 'source_id' => $github_public_source->id,
|
||||
// 'source_type' => GithubApp::class,
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
||||
26
database/seeders/ApplicationSettingsSeeder.php
Normal file
26
database/seeders/ApplicationSettingsSeeder.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\ApplicationSetting;
|
||||
use App\Models\Environment;
|
||||
use App\Models\GithubApp;
|
||||
use App\Models\StandaloneDocker;
|
||||
use App\Models\SwarmDocker;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ApplicationSettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$application_1 = Application::find(1);
|
||||
ApplicationSetting::create([
|
||||
'id' => 1,
|
||||
'application_id' => $application_1->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
28
database/seeders/CoolifyInstanceSettingsSeeder.php
Normal file
28
database/seeders/CoolifyInstanceSettingsSeeder.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\ApplicationSetting;
|
||||
use App\Models\CoolifyInstanceSettings;
|
||||
use App\Models\Environment;
|
||||
use App\Models\GithubApp;
|
||||
use App\Models\StandaloneDocker;
|
||||
use App\Models\SwarmDocker;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CoolifyInstanceSettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
CoolifyInstanceSettings::create([
|
||||
'id' => 1,
|
||||
'wildcard_domain' => 'coolify.io',
|
||||
'is_https_forced' => false,
|
||||
'is_registration_enabled' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
CoolifyInstanceSettingsSeeder::class,
|
||||
UserSeeder::class,
|
||||
TeamSeeder::class,
|
||||
PrivateKeySeeder::class,
|
||||
@@ -22,6 +23,7 @@ class DatabaseSeeder extends Seeder
|
||||
GithubAppSeeder::class,
|
||||
GitlabAppSeeder::class,
|
||||
ApplicationSeeder::class,
|
||||
ApplicationSettingsSeeder::class,
|
||||
DBSeeder::class,
|
||||
ServiceSeeder::class,
|
||||
]);
|
||||
|
||||
@@ -5,9 +5,7 @@ namespace Database\Seeders;
|
||||
use App\Models\PrivateKey;
|
||||
use App\Models\Server;
|
||||
use App\Models\Team;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ServerSeeder extends Seeder
|
||||
{
|
||||
@@ -18,9 +16,10 @@ class ServerSeeder extends Seeder
|
||||
{
|
||||
$root_team = Team::find(1);
|
||||
$private_key_1 = PrivateKey::find(1);
|
||||
|
||||
Server::create([
|
||||
'id' => 1,
|
||||
'name' => "testing-host",
|
||||
'name' => "testing-local-docker-container",
|
||||
'description' => "This is a test docker container",
|
||||
'ip' => "coolify-testing-host",
|
||||
'team_id' => $root_team->id,
|
||||
@@ -28,12 +27,20 @@ class ServerSeeder extends Seeder
|
||||
]);
|
||||
Server::create([
|
||||
'id' => 2,
|
||||
'name' => "testing-host2",
|
||||
'name' => "testing-local-docker-container-2",
|
||||
'description' => "This is a test docker container",
|
||||
'ip' => "coolify-testing-host-2",
|
||||
'team_id' => $root_team->id,
|
||||
'private_key_id' => $private_key_1->id,
|
||||
]);
|
||||
|
||||
Server::create([
|
||||
'id' => 3,
|
||||
'name' => "localhost",
|
||||
'description' => "This is the local machine",
|
||||
'user' => 'ab',
|
||||
'ip' => "172.17.0.1",
|
||||
'team_id' => $root_team->id,
|
||||
'private_key_id' => $private_key_1->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ class StandaloneDockerSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$server_1 = Server::find(1);
|
||||
$server_3 = Server::find(3);
|
||||
StandaloneDocker::create([
|
||||
'id' => 1,
|
||||
'server_id' => $server_1->id,
|
||||
'server_id' => $server_3->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user