gitlab-ci
GitLab CI Configuration file
| Type | object |
|---|---|
| File match |
**/.gitlab-ci.yml
**/.gitlab-ci.yaml
**/*.gitlab-ci.yml
**/*.gitlab-ci.yaml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/gitlab-ci/latest.json |
| Source | https://gitlab.com/gitlab-org/gitlab-foss/-/raw/master/app/assets/javascripts/editor/schema/ci.json |
Validate with Lintel
npx @lintel/lintel check
GitLab has a built-in solution for doing CI called GitLab CI. It is configured by supplying a file called .gitlab-ci.yml, which will list all the jobs that are going to run for the project. A full list of all options can be found here. Learn More.
Properties
Specification for pipeline configuration. Must be declared at the top of a configuration file, in a header section separated from the rest of the configuration with ---. Learn More.
1 nested properties
Define input parameters for reusable CI/CD configuration. Config inputs can optionally specify defaults. Learn More.
Specifies the docker image to use for the job or globally for all jobs. Job configuration takes precedence over global setting. Requires a certain kind of GitLab runner executor. Learn More.
Similar to image property, but will link the specified services to the image container. Learn More.
Defines scripts that should run before the job. Can be set globally or per job. Learn More.
Defines scripts that should run after the job. Can be set globally or per job. Learn More.
Defines default variables for all jobs. Job level property overrides global variables. Learn More.
Use cache to specify a list of files and directories to cache between jobs. You can only use paths that are in the local working copy. Learn More
14 nested properties
Defines scripts that should run after the job. Can be set globally or per job. Learn More.
Used to specify a list of files and directories that should be attached to the job if it succeeds. Artifacts are sent to GitLab where they can be downloaded. Learn More.
9 nested properties
A list of paths to files/folders that should be included in the artifact. Learn More.
A list of paths to files/folders that should be excluded in the artifact. Learn More.
Can be used to expose job artifacts in the merge request UI. GitLab will add a link <expose_as> to the relevant merge request that points to the artifact. Learn More.
Name for the archive created on job success. Can use variables in the name, e.g. '$CI_JOB_NAME' Learn More.
Whether to add all untracked files (along with 'artifacts.paths') to the artifact. Learn More.
Configure when artifacts are uploaded depended on job status. Learn More.
Configure who can access the artifacts. Learn More.
How long artifacts should be kept. They are saved 30 days by default. Artifacts that have expired are removed periodically via cron job. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'. Learn More.
Reports will be uploaded as artifacts, and often displayed in the GitLab UI, such as in merge requests. Learn More.
22 nested properties
Path to JSON file with accessibility report.
Path to JSON file with annotations report.
Path for file(s) that should be parsed as JUnit XML result
Path to a single file with browser performance metric report(s).
Used to collect coverage reports from the job.
Defines scripts that should run before the job. Can be set globally or per job. Learn More.
Specifies lists of commands to execute on the runner at certain stages of job execution. Learn More.
1 nested properties
Use cache to specify a list of files and directories to cache between jobs. You can only use paths that are in the local working copy. Learn More
Specifies the docker image to use for the job or globally for all jobs. Job configuration takes precedence over global setting. Requires a certain kind of GitLab runner executor. Learn More.
Interruptible is used to indicate that a job should be canceled if made redundant by a newer pipeline run. Learn More.
Defines JWTs to be injected as environment variables.
Sets a workload identity (experimental), allowing automatic authentication with the external system. Learn More.
Retry a job if it fails. Can be a simple integer or object definition. Learn More.
Similar to image property, but will link the specified services to the image container. Learn More.
Used to select runners from the list of available runners. A runner must have all tags listed here to run the job. Learn More.
Allows you to configure a timeout for a specific job (e.g. 1 minute, 1h 30m 12s). Learn More.
Groups jobs into stages. All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy']. Learn More.
[
"build",
"test",
"deploy"
]
Can be IncludeItem or IncludeItem[]. Each IncludeItem will be a string, or an object with properties for the method if including external YAML file. The external content will be fetched, included and evaluated along the .gitlab-ci.yml. Learn More.
3 nested properties
Define the rules for when pipeline should be automatically cancelled.
2 nested properties
Define which jobs to stop after a job fails.
Configure the behavior of the auto-cancel redundant pipelines feature. Learn More
Definitions
Used to specify a list of files and directories that should be attached to the job if it succeeds. Artifacts are sent to GitLab where they can be downloaded. Learn More.
A list of paths to files/folders that should be included in the artifact. Learn More.
A list of paths to files/folders that should be excluded in the artifact. Learn More.
Can be used to expose job artifacts in the merge request UI. GitLab will add a link <expose_as> to the relevant merge request that points to the artifact. Learn More.
Name for the archive created on job success. Can use variables in the name, e.g. '$CI_JOB_NAME' Learn More.
Whether to add all untracked files (along with 'artifacts.paths') to the artifact. Learn More.
Configure when artifacts are uploaded depended on job status. Learn More.
Configure who can access the artifacts. Learn More.
How long artifacts should be kept. They are saved 30 days by default. Artifacts that have expired are removed periodically via cron job. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'. Learn More.
Reports will be uploaded as artifacts, and often displayed in the GitLab UI, such as in merge requests. Learn More.
22 nested properties
Path to JSON file with accessibility report.
Path to JSON file with annotations report.
Path for file(s) that should be parsed as JUnit XML result
Path to a single file with browser performance metric report(s).
Used to collect coverage reports from the job.
2 nested properties
Code coverage format used by the test framework.
Path to the coverage report file that should be parsed.
Input type. Defaults to 'string' when not specified.
Human-readable explanation of the parameter.
List of allowed values for this input.
Regular expression that string values must match.
Default value for this input.
Define input parameters for reusable CI/CD configuration. Config inputs can optionally specify defaults. Learn More.
Define input parameters for a job. Job inputs must always include a default value. Learn More.
Specifies the docker image to use for the job or globally for all jobs. Job configuration takes precedence over global setting. Requires a certain kind of GitLab runner executor. Learn More.
Similar to image property, but will link the specified services to the image container. Learn More.
Defines JWTs to be injected as environment variables.
Sets a workload identity (experimental), allowing automatic authentication with the external system. Learn More.
Defines secrets to be injected as environment variables. Learn More.
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. Learn More.
You can use rules to conditionally include other configuration files. Learn More.
Defines the pipeline name. Learn More.
Define the rules for when pipeline should be automatically cancelled.
Define which jobs to stop after a job fails.
Configure the behavior of the auto-cancel redundant pipelines feature. Learn More
Defines default variables for all jobs. Job level property overrides global variables. Learn More.
Defines variables for a job. Learn More.
Defines variables for a rule result. Learn More.
Expression to evaluate whether additional attributes should be provided to the job. Learn More.
Additional attributes will be provided to job if any of the provided paths matches a modified file. Learn More.
Additional attributes will be provided to job if any of the provided paths matches an existing file in the repository. Learn More.
Allows you to configure a timeout for a specific job (e.g. 1 minute, 1h 30m 12s). Learn More.
Used in conjunction with 'when: delayed' to set how long to delay before starting a job. e.g. '5', 5 seconds, 30 minutes, 1 week, etc. Learn More.
Use needs in rules to update job needs for specific conditions. When a condition matches a rule, the job's needs configuration is completely replaced with the needs in the rule. Learn More.
Allow job to fail. A failed job does not cause the pipeline to fail. Learn More.
Splits up a single job into multiple that run in parallel. Provides CI_NODE_INDEX and CI_NODE_TOTAL environment variables to the jobs.
Use the needs:parallel:matrix keyword to specify parallelized jobs needed to be completed for the job to run. Learn More
Describes the conditions for when to run the job. Defaults to 'on_success'. Learn More.
Use cache to specify a list of files and directories to cache between jobs. You can only use paths that are in the local working copy. Learn More
Use the cache:key keyword to give each cache a unique identifying key. All jobs that use the same cache key use the same cache, including in different pipelines. Must be used with cache:path, or nothing is cached. Learn More.
Use the cache:paths keyword to choose which files or directories to cache. Learn More
Determines the strategy for downloading and updating the cache. Learn More
Use unprotect: true to set a cache to be shared between protected and unprotected branches.
Use untracked: true to cache all files that are untracked in your Git repository. Learn More
Defines when to save the cache, based on the status of the job. Learn More.
List of keys to download cache from if no cache hit occurred for key
Filter job by different keywords that determine origin or state, or by supplying string/regex to check against branch/tag names.
Retry a job if it fails. Can be a simple integer or object definition. Learn More.
The number of times the job will be retried if it fails. Defaults to 0 and can max be retried 2 times (3 times total).
Interruptible is used to indicate that a job should be canceled if made redundant by a newer pipeline run. Learn More.
Used to pass input values to included templates, components, downstream pipelines, or child pipelines. Learn More.
Specifies the docker image to use for the job or globally for all jobs. Job configuration takes precedence over global setting. Requires a certain kind of GitLab runner executor. Learn More.
Similar to image property, but will link the specified services to the image container. Learn More.
Defines scripts that should run before the job. Can be set globally or per job. Learn More.
Defines scripts that should run after the job. Can be set globally or per job. Learn More.
Specifies lists of commands to execute on the runner at certain stages of job execution. Learn More.
1 nested properties
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. Learn More.
Defines variables for a job. Learn More.
Use cache to specify a list of files and directories to cache between jobs. You can only use paths that are in the local working copy. Learn More
Defines JWTs to be injected as environment variables.
Sets a workload identity (experimental), allowing automatic authentication with the external system. Learn More.
Define input parameters for a job. Job inputs must always include a default value. Learn More.
Defines secrets to be injected as environment variables. Learn More.
Define what stage the job will run in.
The name of one or more jobs to inherit configuration from.
The list of jobs in previous stages whose sole completion is needed to start the current job.
Used to select runners from the list of available runners. A runner must have all tags listed here to run the job. Learn More.
Allow job to fail. A failed job does not cause the pipeline to fail. Learn More.
Allows you to configure a timeout for a specific job (e.g. 1 minute, 1h 30m 12s). Learn More.
Describes the conditions for when to run the job. Defaults to 'on_success'. Learn More.
Used in conjunction with 'when: delayed' to set how long to delay before starting a job. e.g. '5', 5 seconds, 30 minutes, 1 week, etc. Learn More.
Describes the Custom confirmation message for a manual job Learn More.
Specify a list of job names from earlier stages from which artifacts should be loaded. By default, all previous artifacts are passed. Use an empty array to skip downloading artifacts.
Used to specify a list of files and directories that should be attached to the job if it succeeds. Artifacts are sent to GitLab where they can be downloaded. Learn More.
9 nested properties
A list of paths to files/folders that should be included in the artifact. Learn More.
A list of paths to files/folders that should be excluded in the artifact. Learn More.
Can be used to expose job artifacts in the merge request UI. GitLab will add a link <expose_as> to the relevant merge request that points to the artifact. Learn More.
Name for the archive created on job success. Can use variables in the name, e.g. '$CI_JOB_NAME' Learn More.
Whether to add all untracked files (along with 'artifacts.paths') to the artifact. Learn More.
Configure when artifacts are uploaded depended on job status. Learn More.
Configure who can access the artifacts. Learn More.
How long artifacts should be kept. They are saved 30 days by default. Artifacts that have expired are removed periodically via cron job. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'. Learn More.
Reports will be uploaded as artifacts, and often displayed in the GitLab UI, such as in merge requests. Learn More.
22 nested properties
Path to JSON file with accessibility report.
Path to JSON file with annotations report.
Path for file(s) that should be parsed as JUnit XML result
Path to a single file with browser performance metric report(s).
Used to collect coverage reports from the job.
Used to associate environment metadata with a deploy. Environment can have a name and URL attached to it, and will be displayed under /environments under the project.
Indicates that the job creates a Release.
8 nested properties
The tag_name must be specified. It can refer to an existing Git tag or can be specified by the user.
Specifies the longer description of the Release.
Message to use if creating a new annotated tag.
The Release name. If omitted, it is populated with the value of release: tag_name.
If the release: tag_name doesn’t exist yet, the release is created from ref. ref can be a commit SHA, another tag name, or a branch name.
The title of each milestone the release is associated with.
The date and time when the release is ready. Defaults to the current date and time if not defined. Should be enclosed in quotes and expressed in ISO 8601 format.
1 nested properties
Include asset links in the release.
Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'. Example: '/Code coverage: \d+.\d+/'
Retry a job if it fails. Can be a simple integer or object definition. Learn More.
Splits up a single job into multiple that run in parallel. Provides CI_NODE_INDEX and CI_NODE_TOTAL environment variables to the jobs.
Interruptible is used to indicate that a job should be canceled if made redundant by a newer pipeline run. Learn More.
Limit job concurrency. Can be used to ensure that the Runner will not run certain jobs simultaneously.
Trigger allows you to define downstream pipeline trigger. When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. Learn More.
Controls inheritance of globally-defined defaults and variables. Boolean values control inheritance of all default: or variables: keywords. To inherit only a subset of default: or variables: keywords, specify what you wish to inherit. Anything not listed is not inherited. Learn More.
2 nested properties
Whether to inherit all globally-defined defaults or not. Or subset of inherited defaults. Learn more.
Whether to inherit all globally-defined variables or not. Or subset of inherited variables. Learn More.
Deprecated. Use pages.publish instead. A path to a directory that contains the files to be published with Pages.
Used to select runners from the list of available runners. A runner must have all tags listed here to run the job. Learn More.
Specifies lists of commands to execute on the runner at certain stages of job execution. Learn More.
Any of these function use cases are valid.
GitReference is a reference to a function in a Git repository.
4 nested properties
OCIReference is a reference to a function hosted in an OCI repository.
5 nested properties
The
A path within the registry containing related OCI images. Typically the namespace, project, and image name.
A pointer to the image manifest hosted in the OCI repository.
A directory inside the OCI image where the function can be found.
The name of the file that defines the function, defaults to func.yml.