lasthourcloud/database/seeders/ApplicationSeeder.php

56 lines
1.9 KiB
PHP
Raw Normal View History

<?php
namespace Database\Seeders;
use App\Models\Application;
2023-03-28 15:47:37 +02:00
use App\Models\ApplicationSetting;
use App\Models\Environment;
2023-03-28 12:09:34 +02:00
use App\Models\GithubApp;
2023-03-27 14:31:42 +02:00
use App\Models\StandaloneDocker;
2023-03-27 18:14:33 +02:00
use App\Models\SwarmDocker;
use Illuminate\Database\Seeder;
class ApplicationSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$environment_1 = Environment::find(1);
2023-03-27 14:31:42 +02:00
$standalone_docker_1 = StandaloneDocker::find(1);
2023-03-27 18:14:33 +02:00
$swarm_docker_1 = SwarmDocker::find(1);
2023-03-27 14:31:42 +02:00
2023-03-28 12:09:34 +02:00
$github_public_source = GithubApp::find(1);
$github_private_source = GithubApp::find(2);
2023-03-27 18:14:33 +02:00
Application::create([
'id' => 1,
2023-03-30 15:52:19 +02:00
'name' => 'Public application (from GitHub)',
2023-03-28 15:47:37 +02:00
'git_repository' => 'coollabsio/coolify-examples',
'git_branch' => 'nodejs-fastify',
'build_pack' => 'nixpacks',
'ports_exposes' => '3000',
'ports_mappings' => '3000:3000,3010:3001',
2023-03-27 18:14:33 +02:00
'environment_id' => $environment_1->id,
2023-03-27 14:31:42 +02:00
'destination_id' => $standalone_docker_1->id,
'destination_type' => StandaloneDocker::class,
2023-03-28 12:09:34 +02:00
'source_id' => $github_public_source->id,
'source_type' => GithubApp::class,
]);
Application::create([
'id' => 2,
2023-03-30 15:52:19 +02:00
'name' => 'Private application (through GitHub App)',
'git_repository' => 'coollabsio/nodejs-example',
'git_branch' => 'main',
'build_pack' => 'nixpacks',
'ports_exposes' => '3000',
'ports_mappings' => '3001:3000',
'environment_id' => $environment_1->id,
'destination_id' => $standalone_docker_1->id,
'destination_type' => StandaloneDocker::class,
'source_id' => $github_private_source->id,
'source_type' => GithubApp::class,
]);
}
}