Below is a comprehensive table listing the key stanzas (keywords) used in GitLab CI/CD pipeline configuration files (.gitlab-ci.yml). These keywords are categorized based on their scope and functionality. This information is based on GitLab’s official documentation as of version 18.0.
📘 GitLab CI/CD Pipeline Configuration Keywords
| Keyword | Scope | Description |
|---|---|---|
stages | Global | Defines the stages of the pipeline (e.g., build, test, deploy). |
default | Global | Sets default values for jobs. |
include | Global | Includes external YAML files into the pipeline configuration. |
workflow | Global | Defines conditions to control pipeline creation. |
variables | Global/Job | Defines CI/CD variables. |
image | Global/Job | Specifies the Docker image to use for jobs. |
services | Global/Job | Defines additional Docker services for jobs. |
before_script | Global/Job | Scripts to run before each job’s script. |
after_script | Global/Job | Scripts to run after each job’s script, regardless of success or failure. |
cache | Global/Job | Specifies files to cache between jobs. |
pages | Job | Defines a job that uploads content to GitLab Pages. |
script | Job | The shell commands to execute in the job. |
stage | Job | Assigns the job to a stage. |
only | Job | Specifies the conditions to include the job. (Deprecated in favor of rules) |
except | Job | Specifies the conditions to exclude the job. (Deprecated in favor of rules) |
rules | Job | Specifies conditions to include/exclude jobs. |
needs | Job | Defines job dependencies and allows out-of-order execution. |
dependencies | Job | Specifies artifacts to pass between jobs. |
artifacts | Job | Defines files to save after job completion. |
retry | Job | Specifies the number of retries for a job on failure. |
timeout | Job | Sets a timeout for the job. |
when | Job | Specifies when to run the job (e.g., on_success, manual). |
allow_failure | Job | Allows the job to fail without failing the pipeline. |
parallel | Job | Defines parallel execution of a job. |
trigger | Job | Triggers a downstream pipeline. |
extends | Job | Inherits configuration from other jobs. |
tags | Job | Specifies tags to select specific runners. |
environment | Job | Defines the environment for deployment. |
only:variables | Job | Specifies job inclusion based on variables. (Deprecated in favor of rules) |
except:variables | Job | Specifies job exclusion based on variables. (Deprecated in favor of rules) |
coverage | Job | Specifies how to extract code coverage info. |
secrets | Job | Defines secrets to be used in jobs. |
resource_group | Job | Limits job concurrency. |
interruptible | Job | Allows jobs to be canceled when superseded by newer runs. |
manual | Job | Marks job as manual, requiring user intervention. (Deprecated in favor of when: manual) |
start_in | Job | Delays the execution of a manual job. |
inherit | Job | Controls inheritance of global configurations. |
coverage:regex | Job | Specifies a regex to extract coverage info. |
retry:when | Job | Specifies conditions under which to retry a job. |
release | Job | Defines a release to be created after job completion. |
id_tokens | Job | Defines OpenID Connect (OIDC) tokens for jobs. |
workflow:rules | Global | Defines rules to control pipeline creation. |
workflow:variables | Global | Defines variables at the workflow level. |
workflow:inputs | Global | Defines inputs for the pipeline. |
This table provides a comprehensive overview of the keywords used in GitLab CI/CD pipeline configurations. For detailed information and examples on each keyword, you can refer to the official GitLab CI/CD YAML syntax reference: (GitLab Documentation).(GitLab Documentation)
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals