Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for landlord deployment issues #474

Merged
merged 6 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ APP_NAME="Advising App"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://advisingapp.local
LANDLORD_APP_URL=http://advisingapp.local
APP_URL=${LANDLORD_APP_URL}
APP_FORCE_HTTPS=false
LANDLORD_API_KEY=

Expand Down Expand Up @@ -63,6 +64,7 @@ AWS_SQS_ACCESS_KEY_ID=
AWS_SQS_SECRET_ACCESS_KEY=
SQS_PREFIX=
SQS_QUEUE=
LANDLORD_SQS_QUEUE=landlord
SQS_SUFFIX=
AWS_SQS_DEFAULT_REGION=us-east-1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function run(): void
'number_of_required_approvals' => $type[1],
]);

if (! app()->environment('production')) {
if (app()->environment('local', 'testing')) {
$changeRequestType->userApprovers()->attach(User::where('email', config('local_development.super_admin.email'))->first()->id);
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/Console/Commands/CreateTenantCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ public function handle(): void
);

if ($this->option('run-queue') || $this->confirm('Run the queue to migrate tenant databases?')) {
$queue = config('queue.landlord_queue');

Artisan::call(
command: 'queue:work --queue=landlord --stop-when-empty',
command: "queue:work --queue={$queue} --stop-when-empty",
outputBuffer: $this->output,
);

Expand Down
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class Kernel extends HttpKernel
'landlord-api' => [
// \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
SubstituteBindings::class,
AuthGates::class,
],
];

Expand Down
2 changes: 1 addition & 1 deletion app/Observers/TenantObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function created(Tenant $tenant): void
],
]
)
->onQueue('landlord')
->onQueue(config('queue.landlord_queue'))
->then(function (Batch $batch) use ($tenant) {
Event::dispatch(new NewTenantSetupComplete($tenant));
})
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function boot()
->middleware('landlord-api')
->namespace($this->namespace)
->as('landlord.api.')
->domain('advisingapp.local')
->domain(config('app.landlord_url'))
->group(base_path('routes/landlord_api.php'));

Route::prefix('api')
Expand Down
4 changes: 3 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
|
*/

'url' => env('APP_URL', 'http://localhost'),
'landlord_url' => env('LANDLORD_APP_URL', 'http://localhost'),

'url' => env('APP_URL', env('LANDLORD_APP_URL', 'http://localhost')),

'force_https' => env('APP_FORCE_HTTPS', true),

Expand Down
2 changes: 2 additions & 0 deletions config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],

'landlord_queue' => env('LANDLORD_SQS_QUEUE', 'landlord'),
];