Skip to content

feat: Trigger Lagoon Deployments for App Instances#56

Open
dan2k3k4 wants to merge 5 commits intomainfrom
add-trigger-deploy-and-lagoon-command
Open

feat: Trigger Lagoon Deployments for App Instances#56
dan2k3k4 wants to merge 5 commits intomainfrom
add-trigger-deploy-and-lagoon-command

Conversation

@dan2k3k4
Copy link
Member

@dan2k3k4 dan2k3k4 commented Dec 24, 2025

Introduces the ability to trigger Lagoon deployments for Polydock App Instances directly from the Polydock Engine.

Adds two new Artisan commands for bulk or single-instance deployments and integrates a "Trigger Deploy" action into the Filament Admin UI.

Key Changes

  1. New Console Commands
    • polydock:instances:run-lagoon-command:
      • Method: Uses the Lagoon GraphQL API (via FreedomtechHosting\FtLagoonPhp\Client).
      • Features:
        • Supports concurrency (default: 1) for faster bulk operations.
        • Includes a --variables-only flag for env var updates without full rebuilds.
        • Interactive mode allows selecting specific instances from a list (unless --force is used).
        • Handles authentication via SSH key exchange for Lagoon tokens.
    • polydock:instances:trigger-deploy:
      • Method: Wrapper around the system's lagoon CLI tool.
      • Features: Simple execution of lagoon deploy -p [project] -e [branch] for running instances.
  2. Admin UI Updates
    • ViewPolydockAppInstance:
      • Added a Trigger Deploy header action.
      • Displays a modal confirming the branch and showing the "Last Deployment Date".
      • Executes the deployment via the local lagoon CLI.
  3. Model Updates
    • PolydockAppInstance: Added getName() and setName() convenience methods.
    1. Testing
    • Added tests/Feature/Console/Commands/RunLagoonCommandOnAppInstancesTest.php covering:
      • Serial vs. Concurrent execution.
      • Variable-only deployments.
      • Error handling for missing metadata.
      • Interactive prompts.

How to Test

CLI (API-based):

# Dry run / Interactive selection
php artisan polydock:instances:run-lagoon-command {app_uuid}

# Force run on all instances concurrently
php artisan polydock:instances:run-lagoon-command {app_uuid} --force --concurrency=5

CLI (Lagoon CLI-based):
php artisan polydock:instances:trigger-deploy {app_uuid}

Admin UI:

  1. Navigate to a Polydock App Instance view page.
  2. Click the new Trigger Deploy button in the header.
  3. Confirm the action in the modal.

@dan2k3k4 dan2k3k4 requested a review from bomoko December 24, 2025 20:14
// Construct Lagoon CLI command
// lagoon deploy -p <project> -e <branch>

$fullCommand = sprintf('lagoon deploy -p %s -e %s',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done with the php library.

@dan2k3k4 dan2k3k4 force-pushed the add-trigger-deploy-and-lagoon-command branch from e7af193 to 6c88a3c Compare February 15, 2026 17:06
@dan2k3k4 dan2k3k4 force-pushed the add-trigger-deploy-and-lagoon-command branch from cef3c95 to 579e6f6 Compare February 15, 2026 18:58
@dan2k3k4 dan2k3k4 changed the title chore: artisan add trigger lagoon deploy and run lagoon commands on app instances feat: Trigger Lagoon Deployments for App Instances Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments