iOS GitLab-CI 可持續(xù)化全自動(dòng)打包上傳蒲公英

GitLab-CI就是一套配合GitLab使用的持續(xù)集成系統(tǒng)。

OS X系統(tǒng)完成可出現(xiàn)集成,需要安裝gitlab,gitlab-ci和runner,下面對(duì)gitlab-ci和runner詳細(xì)介紹。

gitlab中的CI

1、在gitlab中完成持續(xù)集成CI包括兩個(gè)操作:

? 配置一個(gè)Runner(用來(lái)編譯、測(cè)試、打包的服務(wù)器節(jié)點(diǎn))。

? 在項(xiàng)目根目錄增加YAML格式的CI腳本文件.gitlab-ci.yml。

2、安裝runner,下面是官網(wǎng)操作

溫馨提示:最好先把rvm和ruby升到最新版。

https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/osx.md

操作:

打開(kāi)終端,下載安裝包:sudo curl --output /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-darwin-amd64

向系統(tǒng)獲取安裝權(quán)限:sudo chmod +x /usr/local/bin/gitlab-ci-multi-runner

開(kāi)始安裝:gitlab-ci-multi-runner register

1、這步輸入自己gitlab網(wǎng)址

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )

https://gitlab.com

2、填注冊(cè)token

Please enter the gitlab-ci token for this runner

xxx

3、這是runner的描述

Please enter the gitlab-ci description for this runner

my-runner

4、設(shè)置runner tags

Please enter the gitlab-ci tags for this runner (comma separated):

iOS

5、這是寫(xiě)用什么腳本,一般用shell

Please enter the executor: shell, docker, docker-ssh, ssh?

shell

6、安裝成功后

Runner registered successfully. Feel free to start it, but if it's

running already the config should be automatically reloaded!

啟動(dòng)

gitlab-ci-multi-runner install

gitlab-ci-multi-runner start


runner成功啟動(dòng)后,可以再gitlab項(xiàng)目設(shè)置里看見(jiàn)啟動(dòng)的runner,圖上顯示token,每個(gè)runner都有自己的runner token,runner內(nèi)有設(shè)置,runner可以設(shè)置為共有和私有,這樣為我們項(xiàng)目持續(xù)集成的工具有了。

3、下面就是設(shè)置yml文件

在gitlab管理項(xiàng)目的根目錄下創(chuàng)建.gitlab-ci.yml文件,這個(gè)文件就是觸發(fā)集成的關(guān)鍵。

這是yml文件的摸板:


./就是運(yùn)行打包腳本,ry.sh就是iOS工程打包腳本,在這個(gè)腳本里編寫(xiě)打包命令。ry.sh文件也是在根目錄下存放。

這個(gè)是ry.sh的命令:

#這里用的是xcodebuild打包命令,主要注意路徑問(wèn)題。

-php index.php是項(xiàng)目打包成功后,上傳蒲公英的腳本。index.php也是存到在根目錄下。

php命令:


4、這樣完成了runner的集成和腳本的編寫(xiě),在用xcode pull代碼的時(shí)候,gitlab-ci直接就集成打包,自動(dòng)將代碼推到蒲公英上。

以上是自己自集成的時(shí)候流程,有不懂得或者不明白的或者錯(cuò)誤的地方,歡迎指正,有碰到問(wèn)題的也歡迎提問(wèn)。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容