About gitlab-cicd-pipeline
A skill for creating GitLab CI/CD pipelines that automate builds, tests, and deployments using GitLab Runner and container execution. It covers pipeline configuration, caching, runners, multi-project flows, and Kubernetes deployment.
Key features
- 01Multi-stage pipeline design
- 02GitLab Runner configuration
- 03Dependency and Docker layer caching
- 04Multi-project pipeline guidance
- 05Kubernetes deployment guidance
Use cases
- 01Setting up CI/CD for a GitLab repository
- 02Building pipelines with multiple stages
- 03Deploying applications to Kubernetes
- 04Optimizing dependency and Docker layer caching
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ aj-geddes/ useful-ai-prompts --skill gitlab-cicd-pipelineAfter installing, type/gitlab-cicd-pipelinein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/complete-pipeline-configuration.mddocker-layer-caching-optimization.mdgitlab-runner-configuration.mdkubernetes-deployment.mdmulti-project-pipeline.mdscripts/validate-pipeline.shtemplates/pipeline.yamlDetails
From the project READMEGitLab CI/CD Pipeline
Table of Contents
Overview
Create comprehensive GitLab CI/CD pipelines that automate building, testing, and deployment using GitLab Runner infrastructure and container execution.
When to Use
- GitLab repository CI/CD setup
- Multi-stage build pipelines
- Docker registry integration
- Kubernetes deployment
- Review app deployment
- Cache optimization
- Dependency management
Quick Start
Minimal working example:
# .gitlab-ci.yml
image: node:18-alpine
variables:
DOCKER_DRIVER: overlay2
FF_USE_FASTZIP: "true"
stages:
- lint
- test
- build
- security
- deploy-review
- deploy-prod
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .npm/
lint:
stage: lint
script:
- npm install
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Complete Pipeline Configuration | Complete Pipeline Configuration |
| GitLab Runner Configuration | GitLab Runner Configuration |
| Docker Layer Caching Optimization | Docker Layer Caching Optimization |
| Multi-Project Pipeline | Multi-Project Pipeline |
| Kubernetes Deployment | Kubernetes Deployment, Performance Testing Stage, Release Pipeline with Semantic Versioning |
Best Practices
✅ DO
- Use stages to organize pipeline flow
- Implement caching for dependencies
- Use artifacts for test reports
- Set appropriate cache keys
- Implement conditional execution with
onlyandexcept - Use
needs:for job dependencies - Clean up artifacts with
expire_in - Use Docker for consistent environments
- Implement security scanning stages
- Set resource limits for jobs
- Use merge request pipelines
❌ DON'T
- Run tests serially when parallelizable
- Cache everything unnecessarily
- Leave large artifacts indefinitely
- Store secrets in configuration files
- Run privileged Docker without necessity
- Skip security scanning
- Ignore pipeline failures
- Use
only: [main]without proper controls
Comments
Markdown supported