gitlab 持续集成
注册 gitlab-runner
gitlab 地址
- Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
gitlab token,在 admin -> Runners 下获取
如果要注册成只为特定项目服务的 Runners,则在 项目 -> setting -> CI/CD -> Runners 下面获取
添加成功的 runnet 会显示在上面的路径下
- Please enter the gitlab-ci token for this runner:
Runner 描述,之后可以在 gitlab 里面修改,用来区分 Runner
- Please enter the gitlab-ci description for this runner:
[gitlab-gitlab-runner1]:
Runner 标记,只会运行 .gitlab-ci.yml 中对应标记的任务(可以通过选中 Runner 的 Run untagged jobs 让 Runner 执行任意的任务)
- Please enter the gitlab-ci tags for this runner (comma separated):
选择 Runner 执行程序
- Please enter the executor: docker-ssh,docker+machine,docker,shell,ssh,virtu
alBox,docker-ssh+machine,kubernetes,parallels:
sudo gitlab-runner register \
--non-interactive \
--url "https://gitlab.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \
--executor "docker" \
--docker-image alpine:3 \
--description "docker-runner" \
--tag-list "docker,aws" \
--run-untagged \
--locked="false" \
设置 gitlab pages
如果是用 docker 安装的 gitlab,并且是映射本机目录持久化的,可能会有权限问题,
设置gitlab_pages['inplace_chroot'] = true
>