gitlab-ci-local
Version:
Tired of pushing to test your .gitlab-ci.yml?
975 lines (974 loc) • 426 kB
JavaScript
export const schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://gitlab.com/.gitlab-ci.yml",
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/). [Learn More](https://docs.gitlab.com/ci/).",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri",
},
"spec": {
"type": "object",
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#spec).",
"properties": {
"inputs": {
"$ref": "#/definitions/inputParameters",
},
},
"additionalProperties": false,
},
"image": {
"$ref": "#/definitions/image",
"markdownDescription": "Defining `image` globally is deprecated. Use [`default`](https://docs.gitlab.com/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ci/yaml/#globally-defined-image-services-cache-before_script-after_script).",
},
"services": {
"$ref": "#/definitions/services",
"markdownDescription": "Defining `services` globally is deprecated. Use [`default`](https://docs.gitlab.com/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ci/yaml/#globally-defined-image-services-cache-before_script-after_script).",
},
"before_script": {
"$ref": "#/definitions/before_script",
"markdownDescription": "Defining `before_script` globally is deprecated. Use [`default`](https://docs.gitlab.com/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ci/yaml/#globally-defined-image-services-cache-before_script-after_script).",
},
"after_script": {
"$ref": "#/definitions/after_script",
"markdownDescription": "Defining `after_script` globally is deprecated. Use [`default`](https://docs.gitlab.com/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ci/yaml/#globally-defined-image-services-cache-before_script-after_script).",
},
"variables": {
"$ref": "#/definitions/globalVariables",
},
"cache": {
"$ref": "#/definitions/cache",
"markdownDescription": "Defining `cache` globally is deprecated. Use [`default`](https://docs.gitlab.com/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ci/yaml/#globally-defined-image-services-cache-before_script-after_script).",
},
"!reference": {
"$ref": "#/definitions/!reference",
},
"default": {
"type": "object",
"properties": {
"after_script": {
"$ref": "#/definitions/after_script",
},
"artifacts": {
"$ref": "#/definitions/artifacts",
},
"before_script": {
"$ref": "#/definitions/before_script",
},
"hooks": {
"$ref": "#/definitions/hooks",
},
"cache": {
"$ref": "#/definitions/cache",
},
"image": {
"$ref": "#/definitions/image",
},
"interruptible": {
"$ref": "#/definitions/interruptible",
},
"id_tokens": {
"$ref": "#/definitions/id_tokens",
},
"identity": {
"$ref": "#/definitions/identity",
},
"retry": {
"$ref": "#/definitions/retry",
},
"services": {
"$ref": "#/definitions/services",
},
"tags": {
"$ref": "#/definitions/tags",
},
"timeout": {
"$ref": "#/definitions/timeout",
},
"!reference": {
"$ref": "#/definitions/!reference",
},
},
"additionalProperties": false,
},
"stages": {
"type": "array",
"markdownDescription": "Groups jobs into stages. All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy']. [Learn More](https://docs.gitlab.com/ci/yaml/#stages).",
"default": [
"build",
"test",
"deploy",
],
"items": {
"anyOf": [
{
"type": "string",
},
{
"type": "array",
"items": {
"type": "string",
},
},
],
},
"uniqueItems": true,
"minItems": 1,
},
"include": {
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#include).",
"oneOf": [
{
"$ref": "#/definitions/include_item",
},
{
"type": "array",
"items": {
"$ref": "#/definitions/include_item",
},
},
],
},
"pages": {
"$ref": "#/definitions/job",
"markdownDescription": "A special job used to upload static sites to GitLab pages. Requires a `public/` directory with `artifacts.path` pointing to it. [Learn More](https://docs.gitlab.com/ci/yaml/#pages).",
},
"workflow": {
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/workflowName",
},
"auto_cancel": {
"$ref": "#/definitions/workflowAutoCancel",
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "string",
},
},
],
"properties": {
"if": {
"$ref": "#/definitions/if",
},
"changes": {
"$ref": "#/definitions/changes",
},
"exists": {
"$ref": "#/definitions/exists",
},
"variables": {
"$ref": "#/definitions/rulesVariables",
},
"when": {
"type": "string",
"enum": [
"always",
"never",
],
},
"auto_cancel": {
"$ref": "#/definitions/workflowAutoCancel",
},
},
"additionalProperties": false,
},
},
},
},
},
"patternProperties": {
"^[.]": {
"description": "Hidden keys.",
"anyOf": [
{
"$ref": "#/definitions/job_template",
},
{
"description": "Arbitrary YAML anchor.",
},
],
},
},
"additionalProperties": {
"$ref": "#/definitions/job",
},
"definitions": {
"artifacts": {
"type": [
"object",
"null",
],
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#artifacts).",
"additionalProperties": false,
"properties": {
"paths": {
"type": "array",
"markdownDescription": "A list of paths to files/folders that should be included in the artifact. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactspaths).",
"items": {
"type": "string",
},
"minItems": 1,
},
"exclude": {
"type": "array",
"markdownDescription": "A list of paths to files/folders that should be excluded in the artifact. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactsexclude).",
"items": {
"type": "string",
},
"minItems": 1,
},
"expose_as": {
"type": "string",
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#artifactsexpose_as).",
},
"name": {
"type": "string",
"markdownDescription": "Name for the archive created on job success. Can use variables in the name, e.g. '$CI_JOB_NAME' [Learn More](https://docs.gitlab.com/ci/yaml/#artifactsname).",
},
"untracked": {
"type": "boolean",
"markdownDescription": "Whether to add all untracked files (along with 'artifacts.paths') to the artifact. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactsuntracked).",
"default": false,
},
"when": {
"markdownDescription": "Configure when artifacts are uploaded depended on job status. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactswhen).",
"default": "on_success",
"type": "string",
"enum": [
"on_success",
"on_failure",
"always",
],
},
"access": {
"markdownDescription": "Configure who can access the artifacts. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactsaccess).",
"default": "all",
"type": "string",
"enum": [
"none",
"developer",
"all",
],
},
"expire_in": {
"type": "string",
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#artifactsexpire_in).",
"default": "30 days",
},
"reports": {
"type": "object",
"markdownDescription": "Reports will be uploaded as artifacts, and often displayed in the GitLab UI, such as in merge requests. [Learn More](https://docs.gitlab.com/ci/yaml/#artifactsreports).",
"additionalProperties": false,
"properties": {
"accessibility": {
"type": "string",
"description": "Path to JSON file with accessibility report.",
},
"annotations": {
"type": "string",
"description": "Path to JSON file with annotations report.",
},
"junit": {
"description": "Path for file(s) that should be parsed as JUnit XML result",
"oneOf": [
{
"type": "string",
"description": "Path to a single XML file",
},
{
"type": "array",
"description": "A list of paths to XML files that will automatically be concatenated into a single file",
"items": {
"type": "string",
},
"minItems": 1,
},
],
},
"browser_performance": {
"type": "string",
"description": "Path to a single file with browser performance metric report(s).",
},
"coverage_report": {
"type": [
"object",
"null",
],
"description": "Used to collect coverage reports from the job.",
"properties": {
"coverage_format": {
"description": "Code coverage format used by the test framework.",
"enum": [
"cobertura",
"jacoco",
],
},
"path": {
"description": "Path to the coverage report file that should be parsed.",
"type": "string",
"minLength": 1,
},
},
},
"codequality": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with code quality report(s) (such as Code Climate).",
},
"dotenv": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files containing runtime-created variables for this job.",
},
"lsif": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files containing code intelligence (Language Server Index Format).",
},
"sast": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with SAST vulnerabilities report(s).",
},
"dependency_scanning": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with Dependency scanning vulnerabilities report(s).",
},
"container_scanning": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with Container scanning vulnerabilities report(s).",
},
"dast": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with DAST vulnerabilities report(s).",
},
"license_management": {
"$ref": "#/definitions/string_file_list",
"description": "Deprecated in 12.8: Path to file or list of files with license report(s).",
},
"license_scanning": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with license report(s).",
},
"requirements": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with requirements report(s).",
},
"secret_detection": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with secret detection report(s).",
},
"metrics": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with custom metrics report(s).",
},
"terraform": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with terraform plan(s).",
},
"cyclonedx": {
"$ref": "#/definitions/string_file_list",
"markdownDescription": "Path to file or list of files with cyclonedx report(s). [Learn More](https://docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscyclonedx).",
},
"load_performance": {
"$ref": "#/definitions/string_file_list",
"markdownDescription": "Path to file or list of files with load performance testing report(s). [Learn More](https://docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportsload_performance).",
},
"repository_xray": {
"$ref": "#/definitions/string_file_list",
"description": "Path to file or list of files with Repository X-Ray report(s).",
},
},
},
},
},
"string_file_list": {
"oneOf": [
{
"type": "string",
},
{
"type": "array",
"items": {
"type": "string",
},
},
],
},
"inputParameters": {
"type": "object",
"markdownDescription": "Define parameters that can be populated in reusable CI/CD configuration files when added to a pipeline. [Learn More](https://docs.gitlab.com/ci/inputs/).",
"patternProperties": {
".*": {
"markdownDescription": "**Input Configuration**\n\nAvailable properties:\n- `type`: string (default), array, boolean, or number\n- `description`: Human-readable explanation of the parameter (supports Markdown)\n- `options`: List of allowed values\n- `default`: Value to use when not specified (makes input optional)\n- `regex`: Pattern that string values must match",
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"markdownDescription": "Force a specific input type. Defaults to 'string' when not specified. [Learn More](https://docs.gitlab.com/ci/inputs/#input-types).",
"enum": [
"array",
"boolean",
"number",
"string",
],
"default": "string",
},
"description": {
"type": "string",
"markdownDescription": "Give a description to a specific input. The description does not affect the input, but can help people understand the input details or expected values. Supports markdown.",
"maxLength": 1024,
},
"options": {
"type": "array",
"markdownDescription": "Specify a list of allowed values for an input.",
"items": {
"oneOf": [
{
"type": "string",
},
{
"type": "number",
},
{
"type": "boolean",
},
],
},
},
"regex": {
"type": "string",
"markdownDescription": "Specify a regular expression that the input must match. Only impacts inputs with a `type` of `string`.",
},
"default": {
"markdownDescription": "Define default values for inputs when not specified. When you specify a default, the inputs are no longer mandatory.",
},
},
"allOf": [
{
"if": {
"properties": {
"type": {
"enum": [
"string",
],
},
},
},
"then": {
"properties": {
"default": {
"type": [
"string",
"null",
],
},
},
},
},
{
"if": {
"properties": {
"type": {
"enum": [
"number",
],
},
},
},
"then": {
"properties": {
"default": {
"type": [
"number",
"null",
],
},
},
},
},
{
"if": {
"properties": {
"type": {
"enum": [
"boolean",
],
},
},
},
"then": {
"properties": {
"default": {
"type": [
"boolean",
"null",
],
},
},
},
},
{
"if": {
"properties": {
"type": {
"enum": [
"array",
],
},
},
},
"then": {
"properties": {
"default": {
"oneOf": [
{
"type": "array",
},
{
"type": "null",
},
],
},
},
},
},
],
"additionalProperties": false,
},
{
"type": "null",
},
],
},
},
},
"include_item": {
"oneOf": [
{
"description": "Will infer the method based on the value. E.g. `https://...` strings will be of type `include:remote`, and `/templates/...` or `templates/...` will be of type `include:local`.",
"type": "string",
"format": "uri-reference",
"anyOf": [
{},
{
"not": {},
},
],
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"local": {
"description": "Relative path from local repository root (`/`) to the `yaml`/`yml` file template. The file must be on the same branch, and does not work across git submodules.",
"type": "string",
"format": "uri-reference",
},
"rules": {
"$ref": "#/definitions/includeRules",
},
"inputs": {
"$ref": "#/definitions/inputs",
},
},
"required": [
"local",
],
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"project": {
"description": "Path to the project, e.g. `group/project`, or `group/sub-group/project` [Learn more](https://docs.gitlab.com/ci/yaml/#includeproject).",
"type": "string",
},
"ref": {
"description": "Branch/Tag/Commit-hash for the target project.",
"type": "string",
},
"file": {
"oneOf": [
{
"description": "Relative path from project root (`/`) to the `yaml`/`yml` file template.",
"type": "string",
},
{
"description": "List of files by relative path from project root (`/`) to the `yaml`/`yml` file template.",
"type": "array",
"items": {
"type": "string",
},
},
],
},
"rules": {
"$ref": "#/definitions/includeRules",
},
"inputs": {
"$ref": "#/definitions/inputs",
},
},
"required": [
"project",
"file",
],
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"template": {
"description": "Use a `.gitlab-ci.yml` template as a base, e.g. `Nodejs.gitlab-ci.yml`.",
"type": "string",
"format": "uri-reference",
},
"rules": {
"$ref": "#/definitions/includeRules",
},
"inputs": {
"$ref": "#/definitions/inputs",
},
},
"required": [
"template",
],
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"component": {
"description": "Local path to component directory or full path to external component directory.",
"type": "string",
"format": "uri-reference",
},
"rules": {
"$ref": "#/definitions/includeRules",
},
"inputs": {
"$ref": "#/definitions/inputs",
},
},
"required": [
"component",
],
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"remote": {
"description": "URL to a `yaml`/`yml` template file using HTTP/HTTPS.",
"type": "string",
"format": "uri-reference",
},
"integrity": {
"description": "SHA256 integrity hash of the remote file content.",
"type": "string",
},
"rules": {
"$ref": "#/definitions/includeRules",
},
"inputs": {
"$ref": "#/definitions/inputs",
},
},
"required": [
"remote",
],
},
],
},
"!reference": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
},
},
"image": {
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "Full name of the image that should be used. It should contain the Registry part if needed.",
},
{
"type": "object",
"description": "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.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Full name of the image that should be used. It should contain the Registry part if needed.",
},
"entrypoint": {
"type": "array",
"description": "Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.",
"minItems": 1,
},
"docker": {
"type": "object",
"markdownDescription": "Options to pass to Runners Docker Executor. [Learn More](https://docs.gitlab.com/ci/yaml/#imagedocker)",
"additionalProperties": false,
"properties": {
"platform": {
"type": "string",
"minLength": 1,
"description": "Image architecture to pull.",
},
"user": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "Username or UID to use for the container.",
},
},
},
"kubernetes": {
"type": "object",
"markdownDescription": "Options to pass to Runners Kubernetes Executor. [Learn More](https://docs.gitlab.com/ci/yaml/#imagekubernetes)",
"additionalProperties": false,
"properties": {
"user": {
"type": [
"string",
"integer",
],
"minLength": 1,
"maxLength": 255,
"description": "Username or UID to use for the container. It also supports the UID:GID format.",
},
},
},
"pull_policy": {
"markdownDescription": "Specifies how to pull the image in Runner. It can be one of `always`, `never` or `if-not-present`. The default value is `always`. [Learn more](https://docs.gitlab.com/ci/yaml/#imagepull_policy).",
"default": "always",
"oneOf": [
{
"type": "string",
"enum": [
"always",
"never",
"if-not-present",
],
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"always",
"never",
"if-not-present",
],
},
"minItems": 1,
"uniqueItems": true,
},
],
},
},
"required": [
"name",
],
},
],
"markdownDescription": "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](https://docs.gitlab.com/ci/yaml/#image).",
},
"services": {
"type": "array",
"markdownDescription": "Similar to `image` property, but will link the specified services to the `image` container. [Learn More](https://docs.gitlab.com/ci/yaml/#services).",
"items": {
"oneOf": [
{
"type": "string",
"minLength": 1,
"description": "Full name of the image that should be used. It should contain the Registry part if needed.",
},
{
"type": "object",
"description": "",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Full name of the image that should be used. It should contain the Registry part if needed.",
"minLength": 1,
},
"entrypoint": {
"type": "array",
"markdownDescription": "Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ci/services/#available-settings-for-services)",
"minItems": 1,
"items": {
"type": "string",
},
},
"docker": {
"type": "object",
"markdownDescription": "Options to pass to Runners Docker Executor. [Learn More](https://docs.gitlab.com/ci/yaml/#servicesdocker)",
"additionalProperties": false,
"properties": {
"platform": {
"type": "string",
"minLength": 1,
"description": "Image architecture to pull.",
},
"user": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "Username or UID to use for the container.",
},
},
},
"kubernetes": {
"type": "object",
"markdownDescription": "Options to pass to Runners Kubernetes Executor. [Learn More](https://docs.gitlab.com/ci/yaml/#imagekubernetes)",
"additionalProperties": false,
"properties": {
"user": {
"type": [
"string",
"integer",
],
"minLength": 1,
"maxLength": 255,
"description": "Username or UID to use for the container. It also supports the UID:GID format.",
},
},
},
"pull_policy": {
"markdownDescription": "Specifies how to pull the image in Runner. It can be one of `always`, `never` or `if-not-present`. The default value is `always`. [Learn more](https://docs.gitlab.com/ci/yaml/#servicespull_policy).",
"default": "always",
"oneOf": [
{
"type": "string",
"enum": [
"always",
"never",
"if-not-present",
],
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"always",
"never",
"if-not-present",
],
},
"minItems": 1,
"uniqueItems": true,
},
],
},
"command": {
"type": "array",
"markdownDescription": "Command or script that should be used as the container's command. It will be translated to arguments passed to Docker after the image's name. The syntax is similar to Dockerfile's CMD directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ci/services/#available-settings-for-services)",
"minItems": 1,
"items": {
"type": "string",
},
},
"alias": {
"type": "string",
"markdownDescription": "Additional alias that can be used to access the service from the job's container. Read Accessing the services for more information. [Learn More](https://docs.gitlab.com/ci/services/#available-settings-for-services)",
"minLength": 1,
},
"variables": {
"$ref": "#/definitions/jobVariables",
"markdownDescription": "Additional environment variables that are passed exclusively to the service. Service variables cannot reference themselves. [Learn More](https://docs.gitlab.com/ci/services/#available-settings-for-services)",
},
},
"required": [
"name",
],
},
],
},
},
"id_tokens": {
"type": "object",
"markdownDescription": "Defines JWTs to be injected as environment variables.",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"aud": {
"oneOf": [
{
"type": "string",
},
{
"type": "array",
"items": {
"type": "string",
},
"minItems": 1,
"uniqueItems": true,
},
],
},
},
"required": [
"aud",
],
"additionalProperties": false,
},
},
},
"identity": {
"type": "string",
"markdownDescription": "Sets a workload identity (experimental), allowing automatic authentication with the external system. [Learn More](https://docs.gitlab.com/ci/yaml/#identity).",
"enum": [
"google_cloud",
],
},
"secrets": {
"type": "object",
"markdownDescription": "Defines secrets to be injected as environment variables. [Learn More](https://docs.gitlab.com/ci/yaml/#secrets).",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"vault": {
"oneOf": [
{
"type": "string",
"markdownDescription": "The secret to be fetched from Vault (e.g. 'production/db/password@ops' translates to secret 'ops/data/production/db', field `password`). [Learn More](https://docs.gitlab.com/ci/yaml/#secretsvault)",
},
{
"type": "object",
"properties": {
"engine": {
"type": "object",
"properties": {
"name": {
"type": "string",
},
"path": {
"type": "string",
},
},
"required": [
"name",
"path",
],
},
"path": {