devops101 › Cheat sheet'ler › 🦊 GitLab CI cheat sheet

🦊 GitLab CI cheat sheet

Temel

stages: [build, test, deploy]Aşamalar
test: stage: test image: node:20 script: - npm ci - npm testJob
variables: NODE_ENV: testDeğişken
cache: key: $CI_COMMIT_REF_SLUG paths: [node_modules/]Cache
artifacts: paths: [dist/] expire_in: 1 weekArtifact

Koşul ve akış

rules: - if: $CI_COMMIT_BRANCH == "main"Koşullu çalıştır
rules: - changes: ["src/**"]Değişen dosyaya göre
needs: [build]DAG: beklemeden başla
when: manualElle onay
environment: productionOrtam
include: - template: Security/SAST.gitlab-ci.ymlŞablon dahil et
extends: .temelYeniden kullan

Uygulamada aç ve alıştırmaları çöz →