在安裝gitlab-runner 環境,因為是需要使用個人帳號執行 pod install 並且需要自動登入,否則會遇到 “gitlab-runner is not running“的問題,所以建議是先在Mac環境中建立獨立的帳號,以下先安裝homebrew 套件,再使用homebrew 安裝gitlab-runner
$ gitlab-runner register
Runtime platform arch=amd64 os=darwin pid=36852 revision=003fe500 version=12.7.1
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://kevinliao.myds.me:30000/
Please enter the gitlab-ci token for this runner:
WwLj3BzUN9sdgtgzziZw
Please enter the gitlab-ci description for this runner:
[Chienyus-iMac.local]: ios-runner
Please enter the gitlab-ci tags for this runner (comma separated):
ios,android,react-native
Registering runner... succeeded runner=WwLj3BzU
Please enter the executor: docker-ssh, shell, ssh, virtualbox, docker+machine, docker-ssh+machine, custom, parallels, kubernetes, docker:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
這裡有個很重要的一點,就是不能使用sudo 去跑system-mode 因為pod install 要求使用user-mode , 如果使用system-mode 會報錯而無法執行。 所以 Gitlab-runner for Mac 不能使用ssh 進行操作 要用 terminal GUI
Please enter the gitlab-ci description for this runner 輸入runner 的名稱
Please enter the gitlab-ci tags for this runner (comma separated) 輸入runner 的tag 後續可以在yml 檔中使用tag讓特定的runner來執行
Please enter the executor: docker-ssh, shell, ssh, virtualbox, docker+machine, docker-ssh+machine, custom, parallels, kubernetes, docker 因為我們這裡使用shell 來執行