C

Ci Setup Rapid

Streamline your workflow with this setup, comprehensive, pipeline, automated. Includes structured workflows, validation checks, and reusable patterns for deployment.

CommandClipticsdeploymentv1.0.0MIT
0 views0 copies

Ci Setup Rapid

Set up complete CI/CD pipelines with automated testing, security scanning, Docker builds, and multi-environment deployment.

When to Use This Command

Run this command when you need to:

  • Bootstrap a complete CI/CD pipeline for a new project with testing, linting, and deployment stages
  • Add security scanning, Docker image building, or multi-environment deployment to an existing pipeline
  • Generate platform-specific workflow files for GitHub Actions, GitLab CI, or Jenkins

Consider alternatives when:

  • You need to trigger an existing CI pipeline run (use power-ci-invoker)
  • You want to test GitHub Actions workflows locally before pushing (use act-action)

Quick Start

Configuration

name: ci-setup-rapid type: command category: deployment

Example Invocation

claude command:run ci-setup-rapid --platform github-actions --stack node --features test,lint,docker,deploy

Example Output

[Detect] Project: Node.js (package.json found)
  Framework: Next.js | Package manager: pnpm
  Test runner: Jest | Linter: ESLint

[Generate] .github/workflows/ci.yml
  Jobs created:
    - lint-and-test (matrix: Node 18, 20)
    - security-scan (npm audit + Snyk)
    - docker-build (multi-stage, cached)
    - deploy-staging (on develop branch)
    - deploy-production (on main branch, manual approval)

[Configure] Branch protection rules recommended:
  - Require lint-and-test to pass before merge
  - Require 1 review approval

[Output] Pipeline file written: .github/workflows/ci.yml

Core Concepts

CI/CD Setup Overview

AspectDetails
PlatformsGitHub Actions, GitLab CI, Jenkins, CircleCI, Azure DevOps
StagesLint, test, security scan, build, Docker, deploy (configurable)
EnvironmentsDevelopment, staging, production with gated promotions
OptimizationDependency caching, parallel jobs, matrix builds

Pipeline Architecture

[Push / PR]
     |
[Lint + Format Check]
     |
[Unit Tests (matrix)]---[Security Scan]
     |                        |
[Build + Docker Image]-------+
     |
[Deploy Staging] (develop branch)
     |
[Deploy Production] (main + approval)

Configuration

ParameterTypeDefaultDescription
platformstringgithub-actionsCI platform: github-actions, gitlab-ci, jenkins, or circleci
stackstringautoTechnology stack: node, python, go, java, or rust (auto-detected)
featuresstringtest,lintComma-separated features: test, lint, security, docker, deploy
environmentsstringstaging,prodDeployment environments to configure
cachebooleantrueEnable dependency and build caching

Best Practices

  1. Start Minimal and Expand - Begin with --features test,lint and add more stages as the team matures. A simple pipeline that everyone follows is better than a complex one that gets bypassed.

  2. Enable Caching from Day One - Dependency installation often takes longer than the actual tests. Enable caching immediately to keep feedback loops under 5 minutes.

  3. Use Matrix Builds for Compatibility - Test against multiple runtime versions (e.g., Node 18 and 20) to catch compatibility issues before they reach production. Matrix builds run in parallel at no extra time cost.

  4. Gate Production with Manual Approval - Automated deployment to staging is safe, but production deployments should require explicit approval. Configure environment protection rules on your CI platform.

  5. Add Security Scanning Early - Integrate dependency vulnerability scanning from the start. Retrofitting security checks into an established pipeline is harder because existing vulnerabilities create noise.

Common Issues

  1. Pipeline Fails on First Run Due to Missing Secrets - The generated workflow references secrets (e.g., DEPLOY_TOKEN) that must be added to your CI platform settings. Check the output for a list of required secrets.

  2. Cache Key Mismatch Across Branches - If different branches use different lockfile versions, cache hits will be inconsistent. Use lockfile hash as the cache key to ensure correct restoration.

  3. Docker Build Exceeds CI Runner Memory - Multi-stage Docker builds on CI runners with limited memory may OOM. Add --memory limits to the Docker build step or use a larger runner instance.

Community

Reviews

Write a review

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

Similar Templates