gitlab-ci-best-practices
БесплатноБез исполняемых скриптовНе проверенUse when optimizing GitLab CI/CD pipelines for performance, reliability, or maintainability. Covers pipeline optimization and organizational patterns.
от TheBushidoCollective★ 202 звезды на GitHubОб этом скилле
GitLab CI - Best Practices
Optimize GitLab CI/CD pipelines for performance, reliability, and maintainability.
Pipeline Optimization
Use DAG with Needs
stages:
- build
- test
- deploy
build:frontend:
stage: build
script: npm run build:frontend
build:backend:
stage: build
script: npm run build:backend
test:frontend:
stage: test
needs: ["build:frontend"]
script: npm run test:frontend
test:backend:
stage: test
needs: ["build:backend"]
script: npm run test:backend
deploy:
stage: deploy
needs: ["test:frontend", "test:backend"]
script: ./deploy.sh
Parallel Execution
test:
parallel:
matrix:
- SUITE: [unit, integration, e2e]
script:
- npm run test:$SUITE
Interruptible Jobs
test:
interruptible: true
script:
- npm test
deploy:production:
interruptible: false # Never cancel
script:
- ./deploy.sh
Configuration Organization
Split Configuration Files
# .gitlab-ci.yml
include:
- local: .gitlab/ci/build.yml
- local: .gitlab/ci/test.yml
- local: .gitlab/ci/deploy.yml
stages:
- build
- test
- deploy
Reusable Templates
.node_template: &node_template
image: node:20-alpine
before_script:
- npm ci
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
test:unit:
<<: *node_template
script:
- npm run test:unit
test:lint:
<<: *node_template
script:
- npm run lint
Extends Keyword
.base_job:
image: node:20-alpine
before_script:
- npm ci
test:
extends: .base_job
script:
- npm test
build:
extends: .base_job
script:
- npm run build
Resource Management
Resource Groups
deploy:staging:
resource_group: staging
script:
- ./deploy.sh staging
deploy:production:
resource_group: production
script:
- ./deploy.sh production
Runner Tags
heavy_build:
tags:
- high-memory
- docker
script:
- ./build.sh
Error Handling
Retry Configuration
test:flaky:
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
- script_failure
Allow Failure
test:experimental:
allow_failure: true
script:
- npm run test:experimental
test:experimental:soft:
allow_failure:
exit_codes: [42] # Only allow specific exit code
Security Best Practices
Protected Pipelines
deploy:production:
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: manual
environment:
name: production
Secure Variables
# Use protected and masked variables
deploy:
script:
- echo "$API_KEY" # Masked in logs
rules:
- if: $CI_COMMIT_REF_PROTECTED == "true"
Monitoring & Debugging
Job Logging
test:
script:
- set -x # Enable debug output
- npm test
after_script:
- echo "Job status: $CI_JOB_STATUS"
Pipeline Badges
[](https://gitlab.com/group/project/-/pipelines)
[](https://gitlab.com/group/project/-/pipelines)
Common Anti-Patterns
Avoid: Running all jobs in sequence Do: Use
needsfor parallel executionAvoid: Downloading all artifacts Do: Use
dependenciesto limit downloadsAvoid: Rebuilding node_modules every job Do: Use cache with lock file keys
Avoid: Hardcoded secrets Do: Use CI/CD variables with protection
Avoid: Single monolithic
.gitlab-ci.ymlDo: Split into multiple included files
Установить gitlab-ci-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobFAQ
Что делает скилл gitlab-ci-best-practices?
Use when optimizing GitLab CI/CD pipelines for performance, reliability, or maintainability. Covers pipeline optimization and organizational patterns.
Как установить скилл gitlab-ci-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gitlab-ci-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub