Organizations implement CD pipelines using pieces of technology such as Jenkins, TravisCI, or GitLab. GitLab is an integrated platform that hosts both the repository and the issue tracker.
A build server is a reusable infrastructure, which enables developers to define custom CD pipelines and is configured through configuration files. In GitLab the configuration file is .gitlab-ci.yml; other build servers have similar configuration files.
组织使用诸如詹金斯(Jenkins),TravisCI或GitLab之类的技术来实现CD管道。 GitLab是一个集成平台,可托管资源库和问题跟踪器。
构建服务器是可重用的基础结构,它使开发人员能够定义自定义CD管道并通过配置文件进行配置。在GitLab中,配置文件为.gitlab-ci.yml;其他构建服务器具有类似的配置文件。
Stages: every change committed to a version control system as Git has to pass these stages during the build, If no stages are defined, the default stages in GitLab are build, test, and deploy.
Jobs: The automation tasks are defined as jobs, the basic unit of the CD pipeline. The example defines two jobs, code_quality and unit_test.
Script: specific scripts that are defined in the script line are invoked. For example, a Java project could include the script line script: mvn test to start all unit tests through the Maven build tool.
When: Developers can also configure when to run a job (e.g., when: manual),
Retry: how many times a job can be auto-retried in case of failures (e.g., retry: 3),
Allow_failure: whether a job is allowed to fail (i.e., allow_failure: true).
阶段:由于在构建过程中Git必须通过这些阶段,因此提交给版本控制系统的每个更改都必须经过这些阶段。如果未定义任何阶段,则GitLab中的默认阶段是构建,测试和部署。
作业:自动化任务定义为作业,是CD管道的基本单位。该示例定义了两个作业,code_quality和unit_test。
脚本:调用脚本行中定义的特定脚本。例如,一个Java项目可以包括脚本行脚本:mvn test以通过Maven构建工具启动所有单元测试。
时间:开发人员还可以配置运行作业的时间(例如,时间:手动),
重试:在发生故障的情况下可以自动重试作业的次数(例如,重试次数:3),
Allow_failure:是否允许作业失败(即allow_failure:true)。