首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

GitLab CI / CD管道配置参考 .gitlab-ci.yml 文件定义内容

关键词

描述

script

由Runner执行的Shell脚本。

image

使用docker映像。也可用:image:name和image:entrypoint。

services

使用docker服务映像。也可用:services:name,services:alias,services:entrypoint,和services:command。

before_script

覆盖作业之前执行的一组命令。

after_script

覆盖作业后执行的一组命令。

stages

定义管道中的阶段。

stage

定义一个作业阶段(默认值:)test。

only

限制创建作业的时间。也可用:only:refs,only:kubernetes,only:variables,和only:changes。

except

限制未创建作业的时间。也可用:except:refs,except:kubernetes,except:variables,和except:changes。

tags

用于选择Runner的标签列表。

allow_failure

允许作业失败。失败的工作不会影响提交状态。

when

什么时候开始工作。也可用:when:manual和when:delayed。

environment

作业部署到的环境的名称。也可用:environment:name,environment:url,environment:on_stop,和environment:action。

cache

在后续运行之间应缓存的文件列表。也可用:cache:paths,cache:key,cache:untracked,和cache:policy。

artifacts

成功时附加到作业的文件和目录列表。也可用:artifacts:paths,artifacts:name,artifacts:untracked,artifacts:when,artifacts:expire_in,artifacts:reports,和artifacts:reports:junit。 在GitLab 企业版,这些都是可供选择:artifacts:reports:codequality,artifacts:reports:sast,artifacts:reports:dependency_scanning,artifacts:reports:container_scanning,artifacts:reports:dast,artifacts:reports:license_management,artifacts:reports:performance和artifacts:reports:metrics。

dependencies

一个作业所依赖的其他作业,以便您可以在它们之间传递工件。

coverage

给定作业的代码覆盖率设置。

retry

发生故障时可以自动重试作业的时间和次数。

parallel

多少个作业实例应并行运行。

trigger

定义下游管道触发器。

include

允许此作业包括外部YAML文件。也可用:include:local,include:file,include:template,和include:remote。

extends

此作业将要继承的配置条目。

pages

上载作业结果以用于GitLab页面。

variables

在作业级别上定义作业变量。

下一篇
举报
领券