gitlab-ci
1
总安装量
1
周安装量
#54833
全站排名
安装命令
npx skills add https://github.com/g1joshi/agent-skills --skill gitlab-ci
Agent 安装分布
mcpjam
1
claude-code
1
replit
1
junie
1
zencoder
1
Skill 文档
GitLab CI/CD
GitLab CI/CD is known for its robust pipeline definition (.gitlab-ci.yml) and Auto DevOps capabilities. In 2025, CI Components replace legacy templates for modular pipeline composition.
When to Use
- GitLab Users: It’s integrated and excellent.
- Complex Pipelines: The DAG (Directed Acyclic Graph) capabilities are sophisticated (
needskeyword). - On-Prem: Excellent support for air-gapped instances.
Quick Start
# .gitlab-ci.yml
stages:
- build
- test
build-job:
stage: build
image: node:20
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
test-job:
stage: test
image: node:20
script:
- npm test
needs: [build-job]
Core Concepts
.gitlab-ci.yml
The heart of the pipeline. Defines stages, jobs, and environment variables.
Runners
The agents that run jobs. Unique feature: Docker-in-Docker support is first-class (using services: docker:dind).
CI Components (2025)
Reusable pipeline parts listed in the CI Catalog. Replaces the old include: template method with versioned, input-driven components.
Best Practices (2025)
Do:
- Use CI Components: Adopt the module catalog.
- Use
rules: Control when jobs run (e.g., only on Merge Requests, or only whenpackage.jsonchanges). - Use
cachevsartifacts: Usecachefor dependencies (node_modules) andartifactsfor output binaries passed between stages.
Don’t:
- Don’t use
only/except: They are deprecated. Userules.