/cicd-unified

DevOps L2+ Production medium usage

/cicd-unified

Overview

/cicd-unified is a production command in the DevOps category of the Prismatic Platform that provides a single entry point for all continuous integration and continuous deployment workflow actions. Instead of managing separate commands for pipeline triggering, status monitoring, artifact retrieval, and deployment control, this command unifies the entire CI/CD lifecycle under one interface. It abstracts away the differences between GitLab CI pipeline syntax, deployment targets (Fly.io staging and production), and quality gate enforcement into a cohesive workflow.

This command operates under the L2+ authority level and is executed by the cicd-tooling-specialist agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The unified approach ensures that all CI/CD operations are subject to the same quality enforcement, telemetry tracking, and doctrine compliance as every other platform command.

The Prismatic Platform's CI/CD infrastructure manages a complex pipeline that must compile nearly 100 umbrella applications, run thousands of tests, enforce zero-warning compilation, execute Credo static analysis, verify Dialyzer type specifications, and deploy to multiple environments. The /cicd-unified command tames this complexity by providing intelligent defaults, automatic pipeline stage detection, and integration with the platform's quality gate system.

Architecture

The command is architected as a facade over the platform's CI/CD subsystem, which itself integrates with GitLab CI, Fly.io deployment, and the internal quality gate infrastructure.

Pipeline Model

The platform uses a multi-stage pipeline model defined in .gitlab-ci.yml. Each stage corresponds to a quality level that must be satisfied before proceeding.

StagePurposeGate
compileZero-warning compilation with --warnings-as-errorsHARD BLOCK
lintCredo strict analysis and formatting checksHARD BLOCK
typecheckDialyzer type specification verificationHARD BLOCK
testFull test suite execution with coverageHARD BLOCK
qualityQuality gate composite score verificationHARD BLOCK
buildDocker image construction (multi-stage)HARD BLOCK
deploy-stagingFly.io staging environment deploymentSOFT (manual trigger)
deploy-productionFly.io production environment deploymentSOFT (manual trigger)

Component Topology

/cicd-unified
    |
    +-- PipelineController
    |     |-- GitLabClient (REST API)
    |     |-- PipelineMonitor (polling/webhook)
    |     +-- ArtifactManager (download/cache)
    |
    +-- DeploymentController
    |     |-- FlyClient (fly.io CLI wrapper)
    |     |-- HealthChecker (post-deploy verification)
    |     +-- RollbackManager (automatic rollback)
    |
    +-- QualityGateEnforcer
          |-- CompilationChecker
          |-- CredoRunner
          |-- DialyzerRunner
          +-- TestRunner

Usage

# Trigger a new pipeline for the current branch
/cicd-unified trigger

# Check the status of the current pipeline
/cicd-unified status

# View detailed pipeline logs for a specific stage
/cicd-unified logs --stage=test

# Deploy to staging after pipeline passes
/cicd-unified deploy --target=staging

# Deploy to production with approval workflow
/cicd-unified deploy --target=production --approve

# Rollback production to previous release
/cicd-unified rollback --target=production

# List recent pipeline runs with results
/cicd-unified history --limit=10

# Download build artifacts
/cicd-unified artifacts --pipeline=latest --stage=build

# Retry a failed pipeline stage
/cicd-unified retry --stage=test --pipeline=latest

# Run quality gates locally before triggering remote pipeline
/cicd-unified preflight

Options

OptionTypeDefaultDescription
actionstringrequiredAction: trigger, status, logs, deploy, rollback, history, artifacts, retry, preflight
--targetstringstagingDeployment target: staging, production
--stagestringallPipeline stage to operate on
--pipelinestringlatestPipeline ID or "latest"
--branchstringcurrentGit branch for pipeline trigger
--approveflagfalseRequire explicit approval for deployment
--limitinteger5Number of history entries to display
--formatstringtextOutput format: text, json, table
--waitflagfalseBlock until pipeline completes
--timeoutinteger1800Timeout for --wait in seconds
--verboseflagfalseShow detailed output including job logs
--dry-runflagfalseShow what would happen without executing

Execution Flow

The execution flow varies by action, but all actions share a common preamble of authentication, context resolution, and quality pre-checks.

  1. Authentication: GitLab API token and Fly.io credentials are validated from environment variables (GITLAB_TOKEN, FLY_API_TOKEN).

  2. Context Resolution: The current git branch, latest commit SHA, and pipeline state are resolved to establish the operational context.

  3. Pre-Check: Quality gates are verified locally to catch obvious issues before triggering remote operations. This prevents wasting CI minutes on pipelines that will fail in the first stage.

  4. Action Dispatch: The requested action is dispatched to the appropriate controller (PipelineController for trigger/status/logs/history/retry, DeploymentController for deploy/rollback).

  5. Execution: The action executes with full telemetry instrumentation. Pipeline triggers use the GitLab REST API, deployments use the Fly.io CLI, and quality checks use local mix tasks.

  6. Result Reporting: Results are formatted and presented with clear status indicators. Failed operations include diagnostic information and suggested remediation steps.

  7. Post-Action Hooks: Session lifecycle hooks record the CI/CD action for audit trail purposes. Deployment actions additionally trigger health checks on the target environment.

Integration Points

ComponentRelationshipDetails
Prismatic AgentsExecuted by cicd-tooling-specialistAgent manages pipeline lifecycle
GitLab CIPipeline backendREST API for trigger, status, logs, artifacts
Quality GatesPre/post execution validationLocal preflight and remote stage gates
TelemetryExecution metricsPipeline duration, stage timing, deployment frequency
AIAD RegistryCommand specificationCI/CD command configuration
Fly.ioDeployment targetStaging and production hosting
DockerImage buildingMulti-stage builds for production
/guardrailsDeployment safetyPre-deployment safety checks

Best Practices

Run preflight before triggering. The preflight action runs all quality checks locally in under 60 seconds. This catches compilation warnings, Credo violations, and test failures before consuming CI minutes on the remote pipeline.

Use staging before production. Always deploy to staging first and verify the application health before promoting to production. The command enforces this by requiring --approve for production deployments.

Monitor pipeline duration trends. Use history to track pipeline duration over time. A gradually increasing pipeline time often indicates growing test suites or dependency resolution issues that should be addressed.

Pin pipeline references. When discussing specific pipelines in issues or documentation, use the pipeline ID rather than "latest" to ensure the reference remains stable over time.

Configure timeout appropriately. The full pipeline for the Prismatic Platform with nearly 100 umbrella apps takes 15-25 minutes. Set --timeout accordingly when using --wait.

Use atomic deployments. The Fly.io deployment strategy uses blue-green deployment with health checks. If the new version fails health checks, the deployment automatically rolls back without operator intervention.

Error Handling

ErrorCauseResolution
gitlab_auth_failureInvalid or expired GITLAB_TOKENRegenerate token in GitLab settings
pipeline_trigger_failedBranch protection or CI configuration errorVerify branch permissions and .gitlab-ci.yml
stage_timeoutPipeline stage exceeded time limitCheck for hanging tests or resource contention
deploy_health_check_failedApplication failed post-deploy health checkAutomatic rollback triggered, investigate logs
fly_auth_failureInvalid FLY_API_TOKENRe-authenticate with fly auth token
quality_gate_blockedPre-flight quality check failedFix reported issues before triggering pipeline
artifact_not_foundRequested artifact expired or never createdCheck pipeline configuration for artifact retention
rollback_failedNo previous release availableManual intervention required via Fly.io dashboard

Advanced Usage

Pipeline Scheduling

Schedule pipelines for off-peak execution to optimize CI resource utilization.

# Schedule pipeline for 2 AM
/cicd-unified trigger --schedule="02:00" --branch=main

# Trigger nightly full pipeline
/cicd-unified trigger --full --schedule="nightly"

Custom Pipeline Variables

Pass custom variables to pipeline runs for conditional stage execution.

# Skip deployment stages
/cicd-unified trigger --var="SKIP_DEPLOY=true"

# Run extended test suite
/cicd-unified trigger --var="TEST_SUITE=extended"

Multi-Environment Deployment

Deploy specific commits to specific environments with environment-specific configuration.

# Deploy specific SHA to staging
/cicd-unified deploy --target=staging --sha=abc1234

# Promote staging to production (uses staging's verified image)
/cicd-unified deploy --target=production --promote-from=staging

GitLab CI YAML Compliance

The platform enforces strict GitLab CI YAML patterns. The command validates YAML before submission.

# Validate CI configuration
/cicd-unified validate-yaml

# Lint CI configuration with platform standards
/cicd-unified lint-yaml --strict

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. Every pipeline stage must pass before deployment is permitted. No bypass flags.
  • NO DOUBTS: Full investigation before action, evidence-based results. Pipeline results are fully auditable with complete logs and artifact preservation.
  • /guardrails - CI/CD guardrails enforcement for deployment safety
  • /gitlab-ci - GitLab CI/CD pipeline management and configuration
  • /gitlab-api - GitLab API operations for project and repository management
  • /quality-gates - Enforce quality gate checkpoints with zero-warning compilation validation
  • /commit - Smart commit with quality gates and conventional format
  • /connect - MCP server connection management across 14+ servers

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL