gitlab说明书

GitLab Runner 来执行构建任务

GitLab CI 是 GitLab 的一部分,如果由 GitLab CI 来运行构建任务的话,在执行构建任务的时候,GitLab 的性能会大幅下降。

GitLab CI 最大的作用是管理各个项目的构建状态,因此,运行构建任务这种浪费资源的事情就交给 GitLab Runner 来做拉!

因为 GitLab Runner 可以安装到不同的机器上,所以在构建任务运行期间并不会影响到 GitLab 的性能

每个版本的不同说明也会不同:

  • gitlab-ci-multi-runner register:执行注册命令
  • Please enter the gitlab-ci coordinator URL:输入 ci 地址
  • Please enter the gitlab-ci token for this runner:输入 ci token
  • Please enter the gitlab-ci description for this runner:输入 runner 名称
  • Please enter the gitlab-ci tags for this runner:设置 tag
  • Whether to run untagged builds:这里选择 true ,代码上传后会能够直接执行
  • Whether to lock Runner to current project:直接回车,不用输入任何口令
  • Please enter the executor:选择 runner 类型,这里我们选择的是 shell

 

CI脚本中部分节点说明:

  • stages:定义构建阶段,这里只有一个阶段 deploy
  • deploy:构建阶段 deploy 的详细配置也就是任务配置
  • script:需要执行的 shell 脚本
  • only:这里的 master 指在提交到 master 时执行
  • tags:与注册 runner 时的 tag 匹配
posted @ 2020-06-15 11:13  快闪开,我要起飞了  阅读(254)  评论(0编辑  收藏  举报