首先需要在本机上安装 GitLab Runner, 由于微信开发者工具只提供了 mac 和 windows 版本,所以目前只能在这两种系统上实现持续集成,本文讲述在 mac 的具体实现, windows 上的实现与此类似,只是相关命令和路径需要做些变更
注册 GitLab Runner
1 2
gitlab-runner register
注意,注册时没有sudo, 因为需要使用用户模式来使用,而非系统模式
注册时,将本机添加上了 mac 标签, 运行模式为shell,这样可以在部署时,指定运行环境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/): https://xxxxxx.com/ Please enter the gitlab-ci token for this runner: xxxxxx Please enter the gitlab-ci description for this runner: [xxx.com]: macbook.home Please enter the gitlab-ci tags for this runner (comma separated): mac,shell Whether to run untagged builds [true/false]: [false]: true Whether to lock the Runner to current project [true/false]: [true]: false Registering runner... succeeded runner=Gd3NhK2t Please enter the executor: docker-ssh, virtualbox, docker+machine, docker-ssh+machine, docker, parallels, shell, ssh, kubernetes: shell Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!