Gitlab JC/CD 第一篇

2018/04/23 git lab

just now

  • 不再介绍如何安装Gitlab
  • runner 开始介绍

配置Runner

  • 管理员用户登录 第一步

  • 第二步进入Runner配置项

  • 获得runner的注册信息

  • 启动一个Runner 并且配置

sudo docker run -d --name gitlab-java --restart always \
  -v /srv/gitlab-java/config:/etc/gitlab-runner \
  -v /var/run/docker.sock:/var/run/docker.sock \
  gitlab/gitlab-runner:latest

  • 注册runner 到 Gitlab
sudo docker exec -it gitlab-java gitlab-runner register \
  --url "http://gitlab.emosa.com/" \
  --registration-token "hyNYzSsoJKjGqy1y4D-Q" \
  --executor docker \
  --description "Java-Runner" \
  --docker-image "debian" \
  --docker-volumes /var/run/docker.sock:/var/run/docker.sock


# gitlab-runner register
Please enter the gitlab-ci coordinator URL:
# 示例:http://gitlab.emosa.com/
Please enter the gitlab-ci token for this runner:
# hyNYzSsoJKjGqy1y4D-Q
Please enter the gitlab-ci description for this runner:
# Java-Runner
Please enter the gitlab-ci tags for this runner (comma separated):
# java
这个地方还有一个配置 默认即可
#false
Whether to run untagged builds [true/false]:
# true
Please enter the executor: docker, parallels, shell, kubernetes, docker-ssh, ssh, virtualbox, docker+machine, docker-ssh+machine:
# docker
Please enter the default Docker image (e.g. ruby:2.1):
# debian

  • 检查启动结果

  • Gitlab Runner 就配置完成了。

转载请注明出处,本文采用 CC4.0 协议授权

Affiliate

Search

    Post Directory