From f9d24db9f879b747c1941c55f9f1e64a63e07b18 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 17 Oct 2023 23:19:28 +1100 Subject: [PATCH] Minor changes to optimise new installs --- .env.example | 7 ++-- .env.testing | 2 +- .gitlab-docker-armv7l.yml | 2 +- .gitlab-docker-x86_64.yml | 2 +- app/Console/Commands/InitialSetup.php | 34 ------------------- database/seeders/DatabaseSeeder.php | 4 +-- ...nitialSetupSeeder.php => InitialSetup.php} | 22 ++---------- ...odeHierarchy.php => TestNodeHierarchy.php} | 2 +- tests/Feature/RoutingTest.php | 10 +++--- 9 files changed, 18 insertions(+), 67 deletions(-) delete mode 100644 app/Console/Commands/InitialSetup.php rename database/seeders/{InitialSetupSeeder.php => InitialSetup.php} (75%) rename database/seeders/{NodeHierarchy.php => TestNodeHierarchy.php} (99%) diff --git a/.env.example b/.env.example index ee9b45c..e52c38f 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,8 @@ APP_NAME="Clearing Houz" APP_ENV=production APP_KEY= APP_DEBUG=false -APP_URL=http://localhost +APP_URL=http://clrghouz +APP_TIMEZONE= LOG_CHANNEL=stack LOG_LEVEL=info @@ -10,8 +11,8 @@ LOG_LEVEL=info DB_CONNECTION=pgsql DB_HOST=postgres DB_PORT=5432 -DB_DATABASE=laravel -DB_USERNAME=laravel +DB_DATABASE=clrghouz +DB_USERNAME=clrghouz DB_PASSWORD= #DB_SSLMODE=prefer #DB_SSLROOTCERT=/var/www/html/config/ssl/ca.crt diff --git a/.env.testing b/.env.testing index bca7f1d..1b41ce9 100644 --- a/.env.testing +++ b/.env.testing @@ -2,7 +2,7 @@ APP_NAME="Clearing Houz Testing" APP_ENV=testing APP_KEY=base64:FiMSvv4J7jDfy6W/sHrQ9YImuUYaxynYCcXQJwp/6Tc= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://clrghouz APP_TIMEZONE=Australia/Melbourne LOG_CHANNEL=stderr diff --git a/.gitlab-docker-armv7l.yml b/.gitlab-docker-armv7l.yml index 5c16d63..629c454 100644 --- a/.gitlab-docker-armv7l.yml +++ b/.gitlab-docker-armv7l.yml @@ -7,7 +7,7 @@ armv7l:build: script: - if [ -f init ]; then chmod 500 init; fi - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - - rm -rf vendor/ database/schema database/seeders database/factories/* + - rm -rf vendor/ database/schema database/seeders/Test*.php database/factories/* - docker build -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml index 3b89dac..ecb12cb 100644 --- a/.gitlab-docker-x86_64.yml +++ b/.gitlab-docker-x86_64.yml @@ -7,7 +7,7 @@ x86_64:build: script: - if [ -f init ]; then chmod 500 init; fi - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - - rm -rf vendor/ database/schema database/seeders database/factories/* + - rm -rf vendor/ database/schema database/seeders/Test*.php database/factories/* - docker build -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} diff --git a/app/Console/Commands/InitialSetup.php b/app/Console/Commands/InitialSetup.php deleted file mode 100644 index 793837b..0000000 --- a/app/Console/Commands/InitialSetup.php +++ /dev/null @@ -1,34 +0,0 @@ -InitialSetupSeeder::class]); - } -} \ No newline at end of file diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 2448c4a..256ce0a 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -13,7 +13,7 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(InitialSetupSeeder::class); - $this->call(NodeHierarchy::class); + $this->call(InitialSetup::class); + $this->call(TestNodeHierarchy::class); } } diff --git a/database/seeders/InitialSetupSeeder.php b/database/seeders/InitialSetup.php similarity index 75% rename from database/seeders/InitialSetupSeeder.php rename to database/seeders/InitialSetup.php index 93789fa..9a19750 100644 --- a/database/seeders/InitialSetupSeeder.php +++ b/database/seeders/InitialSetup.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\DB; use App\Models\{Domain,Software,System,Zone}; -class InitialSetupSeeder extends Seeder +class InitialSetup extends Seeder { /** * Run the database seeds. @@ -65,28 +65,12 @@ class InitialSetupSeeder extends Seeder ]); DB::table('users')->insert([ - 'name'=>'Deon George', - 'email'=>'deon@leenooks.net', + 'name'=>'System Admin', + 'email'=>'admin@clrghouz', 'email_verified_at'=>Carbon::now(), 'admin'=>TRUE, 'active'=>TRUE, 'password'=>'$2y$10$bJQDLfxnKrh6o5Sa02MZOukXcLTNQiByXSTJ7fTr.kHMpV2wxbG6.', ]); - - DB::table('echoareas')->insert([ - 'name'=>'-BAD_AREA', - 'description'=>'Inbound invalid echomail', - 'active'=>TRUE, - 'show'=>TRUE, - 'domain_id'=>$do->id, - ]); - - DB::table('fileareas')->insert([ - 'name'=>'-BAD_AREA', - 'description'=>'Inbound invalid files', - 'active'=>TRUE, - 'show'=>TRUE, - 'domain_id'=>$do->id, - ]); } } diff --git a/database/seeders/NodeHierarchy.php b/database/seeders/TestNodeHierarchy.php similarity index 99% rename from database/seeders/NodeHierarchy.php rename to database/seeders/TestNodeHierarchy.php index 82578a3..6b5ebce 100644 --- a/database/seeders/NodeHierarchy.php +++ b/database/seeders/TestNodeHierarchy.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\DB; use App\Models\{Address,Domain,System,Zone}; -class NodeHierarchy extends Seeder +class TestNodeHierarchy extends Seeder { public const DEBUG=TRUE; diff --git a/tests/Feature/RoutingTest.php b/tests/Feature/RoutingTest.php index 3abca1d..7cc2393 100644 --- a/tests/Feature/RoutingTest.php +++ b/tests/Feature/RoutingTest.php @@ -26,7 +26,7 @@ class RoutingTest extends TestCase */ public function test_zc() { - //$this->seed(NodeHierarchy::class); + //$this->seed(TestNodeHierarchy::class); $nodes = $this->zone(); $this->assertEquals(52,$nodes->count()); @@ -100,7 +100,7 @@ class RoutingTest extends TestCase */ public function test_rc() { - //$this->seed(NodeHierarchy::class); + //$this->seed(TestNodeHierarchy::class); // Pick ZC without any session info - we have 0 children $ao = Address::findFTN('100:1/0@domain-a'); @@ -147,7 +147,7 @@ class RoutingTest extends TestCase */ public function test_nc() { - //$this->seed(NodeHierarchy::class); + //$this->seed(TestNodeHierarchy::class); // Pick a HC without any session info - we have 0 children $ao = Address::findFTN('100:20/0@domain-a'); @@ -181,7 +181,7 @@ class RoutingTest extends TestCase */ public function test_hc() { - //$this->seed(NodeHierarchy::class); + //$this->seed(TestNodeHierarchy::class); // Pick a HC without any session info - we have 0 children $ao = Address::findFTN('100:20/2000@domain-a'); @@ -202,7 +202,7 @@ class RoutingTest extends TestCase public function test_node() { - //$this->seed(NodeHierarchy::class); + //$this->seed(TestNodeHierarchy::class); // Node with session details still doesnt have any children $ao = Address::findFTN('100:20/2001@domain-a');