From 3461e60d44da7e3f8939f202c7031eb590b61acf Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Thu, 19 Feb 2026 14:55:51 -0500 Subject: [PATCH 1/2] feat: add Lagoon Script Configuration section with lifecycle scripts for app management --- .../Resources/PolydockStoreAppResource.php | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/app/Filament/Admin/Resources/PolydockStoreAppResource.php b/app/Filament/Admin/Resources/PolydockStoreAppResource.php index 0193ca4..a65dac2 100644 --- a/app/Filament/Admin/Resources/PolydockStoreAppResource.php +++ b/app/Filament/Admin/Resources/PolydockStoreAppResource.php @@ -64,6 +64,111 @@ public static function form(Form $form): Form ->required() ->maxLength(255) ->default('main'), + Section::make('Lagoon Script Configuration') + ->description('Optional scripts run during app lifecycle stages.') + ->schema([ + Section::make('Post Deploy') + ->schema([ + Forms\Components\Textarea::make('lagoon_post_deploy_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_post_deploy_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_post_deploy_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Pre Upgrade') + ->schema([ + Forms\Components\Textarea::make('lagoon_pre_upgrade_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_pre_upgrade_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_pre_upgrade_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Upgrade') + ->schema([ + Forms\Components\Textarea::make('lagoon_upgrade_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_upgrade_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_upgrade_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Post Upgrade') + ->schema([ + Forms\Components\Textarea::make('lagoon_post_upgrade_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_post_upgrade_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_post_upgrade_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Claim') + ->schema([ + Forms\Components\Textarea::make('lagoon_claim_script') + ->label('Script') + ->rows(3) + ->helperText('When set, command output must be a valid URL and becomes app URL.'), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_claim_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_claim_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Pre Remove') + ->schema([ + Forms\Components\Textarea::make('lagoon_pre_remove_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_pre_remove_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_pre_remove_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + Section::make('Remove') + ->schema([ + Forms\Components\Textarea::make('lagoon_remove_script') + ->label('Script') + ->rows(3), + Grid::make(2)->schema([ + Forms\Components\TextInput::make('lagoon_remove_service') + ->maxLength(255) + ->placeholder('cli'), + Forms\Components\TextInput::make('lagoon_remove_container') + ->maxLength(255) + ->placeholder('cli'), + ]), + ]), + ]) + ->collapsible() + ->collapsed(), Forms\Components\Select::make('status') ->options(PolydockStoreAppStatusEnum::class) ->required(), From 5d617bf592ac361be960ac8a72678053479d7ee7 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Thu, 19 Feb 2026 14:56:14 -0500 Subject: [PATCH 2/2] feat: enhance registration response with additional Lagoon project details --- app/Http/Controllers/Api/RegisterController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/RegisterController.php b/app/Http/Controllers/Api/RegisterController.php index 4370841..06a5e9c 100644 --- a/app/Http/Controllers/Api/RegisterController.php +++ b/app/Http/Controllers/Api/RegisterController.php @@ -52,6 +52,7 @@ public function showRegister(string $uuid): JsonResponse try { $registration = UserRemoteRegistration::where('uuid', $uuid)->firstOrFail(); Log::info('Showing user remote registration', ['registration' => $registration->toArray()]); + $responseResultData = $registration->result_data ?? []; if ($registration->appInstance) { $appInstance = $registration->appInstance; @@ -65,12 +66,20 @@ public function showRegister(string $uuid): JsonResponse $registration->setResultValue('result_type', 'registration_failed'); $registration->save(); } + + if ($appInstance->getKeyValue('lagoon-project-id')) { + $responseResultData['lagoon-project-id'] = $appInstance->getKeyValue('lagoon-project-id'); + } + + if ($appInstance->getKeyValue('lagoon-deploy-branch')) { + $responseResultData['lagoon-deploy-branch'] = $appInstance->getKeyValue('lagoon-deploy-branch'); + } } return response()->json([ 'status' => $registration->status->value, 'email' => $registration->email, - 'result_data' => $registration->result_data, + 'result_data' => $responseResultData, 'created_at' => $registration->created_at, 'updated_at' => $registration->updated_at, ]);