玩转GitLab-CI+蒲公英可持续化全自动打包

 1 gitlab-runner 安装 

  • 1.1 下载执行文件
# Linux x86-64
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

# Linux x86
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386

# Linux arm
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm
  • 1.2 设置执行权限
sudo chmod +x /usr/local/bin/gitlab-runner
  • 1.3 创建 GitLab CI 用户
useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
  • 1.4 运行服务
gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
gitlab-runner start

2 gitlab-runner 注册

2.1 获取 Gitlab 注册令牌

打开 gitlab 项目 -> 设置 -> CI / CD -> Runners 设置

玩转GitLab-CI+蒲公英可持续化全自动打包_第1张图片

 

2.2 LINUX 注册

  • 运行注册
sudo gitlab-runner register
  • 输入你的 GitLab URL
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://xxx.xxx
  • 输入 注册令牌 来注册 Runner
Please enter the gitlab-ci token for this runner
xxx
  • 输入 Runner 说明
Please enter the gitlab-ci description for this runner
[hostame] my-runner
  • 输入 Runner 的 tags
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
  • 输入 Runner 执行方式
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
shell
  • 如果是在 Docker 中运行, you'll be asked for the default image to be used for projects that do not define one in .gitlab-ci.yml:
Please enter the Docker image (eg. ruby:2.1):
alpine:latest

3 链接成功

3.1 runner 列表

玩转GitLab-CI+蒲公英可持续化全自动打包_第2张图片

 

3.2 runner 修改

 

玩转GitLab-CI+蒲公英可持续化全自动打包_第3张图片

4 编写 .gitlab-ci.yml 集成

玩转GitLab-CI+蒲公英可持续化全自动打包_第4张图片

5 配置蒲公英

玩转GitLab-CI+蒲公英可持续化全自动打包_第5张图片

6 执行集成

  • 下次提交代码就会走集成任务了

 

  • 任务阶段

 玩转GitLab-CI+蒲公英可持续化全自动打包_第6张图片

 

  • 详情

 

 

玩转GitLab-CI+蒲公英可持续化全自动打包_第7张图片

 

 

你可能感兴趣的:(IOS开发)