E

Easy Setup Ci Cd

Production-ready command that handles setup, comprehensive, pipeline, automated. Includes structured workflows, validation checks, and reusable patterns for setup.

CommandClipticssetupv1.0.0MIT
0 views0 copies

Easy Setup CI/CD

Set up a complete CI/CD pipeline with build automation, testing, quality gates, deployment strategies, and monitoring integration for GitHub Actions, GitLab CI, or Azure Pipelines.

When to Use This Command

Run this command when...

  • You are setting up automated build, test, and deployment workflows for a new or existing project
  • You need GitHub Actions workflows, GitLab CI pipelines, or Azure Pipelines configurations generated from scratch
  • You want quality gates including linting, security scanning, and code coverage thresholds in your pipeline
  • You need deployment automation with blue-green, canary, or rolling deployment strategies
  • You want secrets management, environment provisioning, and approval workflows integrated into your pipeline

Quick Start

# .claude/commands/easy-setup-ci-cd.yaml name: Easy Setup CI/CD description: Setup comprehensive CI/CD pipeline with deployment automation inputs: - name: platform description: "github-actions, gitlab-ci, or azure-pipelines" default: "github-actions"
# Setup GitHub Actions CI/CD claude "easy-setup-ci-cd --platform github-actions" # Setup with specific deployment target claude "easy-setup-ci-cd --platform github-actions --deploy vercel --env staging,production"
Output:
  [detect] Repository: GitHub (origin: github.com/org/repo)
  [detect] Stack: Node.js 20, React, PostgreSQL
  [create] .github/workflows/ci.yml (lint, test, build)
  [create] .github/workflows/deploy-staging.yml
  [create] .github/workflows/deploy-production.yml
  [config] Quality gates: coverage > 80%, 0 lint errors
  [config] Deploy: Vercel preview on PR, production on main
  Done. 3 workflow files created. Push to activate.

Core Concepts

ConceptDescription
Pipeline ArchitectureMulti-stage pipeline: install, lint, test, build, deploy with parallel job execution
Quality GatesAutomated checks that block deployment: test pass rate, coverage thresholds, lint results, security scans
Deployment StrategiesBlue-green (zero downtime), canary (gradual rollout), or rolling deployments with rollback triggers
Environment ManagementSeparate staging and production pipelines with environment-specific secrets and configurations
Approval WorkflowsRequired manual approvals before production deployments with notification to designated reviewers
Pipeline Flow:
  Push/PR
    β”‚
  β”Œβ”€β–Όβ”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚Install  │──>β”‚  Lint  │──>β”‚  Test  │──>β”‚ Build  β”‚
  β”‚  Deps   β”‚   β”‚& Formatβ”‚   β”‚& Cover β”‚   β”‚Artifactβ”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                                               β”‚
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                              β–Ό                β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚ Staging │────>β”‚Productionβ”‚
                         β”‚ Deploy  β”‚     β”‚ (Approve)β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

ParameterTypeDefaultDescription
platformstring"github-actions"CI/CD platform: github-actions, gitlab-ci, or azure-pipelines
deploystring""Deployment target: vercel, aws, gcp, netlify, or docker registry
envstring"staging,production"Comma-separated environment names to create pipelines for
coverageinteger80Minimum code coverage percentage required to pass quality gate
strategystring"rolling"Deployment strategy: rolling, blue-green, or canary

Best Practices

  1. Start with CI before CD -- Get your build and test pipeline green before adding deployment automation. A deployment pipeline built on unreliable tests creates false confidence.
  2. Cache dependencies aggressively -- Configure npm, pip, or cargo caching in your pipeline to reduce build times from minutes to seconds on repeated runs.
  3. Use matrix builds for cross-version testing -- Test against multiple Node.js, Python, or runtime versions to catch compatibility issues before users report them.
  4. Require staging deployment before production -- Never deploy directly to production. The pipeline should enforce staging deployment and verification as a prerequisite.
  5. Store secrets in the platform's vault -- Use GitHub Secrets, GitLab CI variables, or Azure Key Vault. Never hardcode credentials in pipeline configuration files.

Common Issues

  1. Workflow not triggering -- GitHub Actions workflows must be in .github/workflows/ on the default branch to be recognized. Push the workflow files to main first.
  2. Secrets not available in pull requests -- For security, most CI platforms do not expose secrets to pull requests from forks. Use a separate workflow for community contributions.
  3. Build cache not working -- Cache keys must match exactly. If dependencies change but the cache key does not, stale caches produce build failures. Include lock file hashes in cache keys.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates