使用終端安裝Jenkins
1隆敢、安裝Jenkins
$ brew install jenkins
如果brew無(wú)效,安裝homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2脚作、啟動(dòng)Jenkins
$ jenkins
如果要卸載Jenkins及相關(guān)配置
//進(jìn)入以下目錄钝尸,雙擊運(yùn)行
/Library/Application Support/Jenkins/Uninstall.command
//也可以這樣運(yùn)行
sh "/Library/Application Support/Jenkins/Uninstall.command"
//刪除配置挎狸,這個(gè)可選
sudo rm -rf /var/root/.jenkins ~/.jenkins
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins
sudo rm -rf /Users/Shared/Jenkins
sudo dscl . -delete /Users/jenkins
sudo dscl . -delete /Groups/jenkins
sudo rm -f /etc/newsyslog.d/jenkins.conf
pkgutil --pkgs | grep 'org\.jenkins-ci\.' | xargs -n 1 sudo pkgutil --forget
//如果使用brew安裝的钾埂,可以執(zhí)行以下命令
$ brew uninstall jenkins
3、在瀏覽器中輸入http://localhost:8080
4科平、安裝插件
Xcode integration
GIT plugin
Post-Build Script Plug-in
GitHub plugin
5褥紫、配置SSH Key
6、構(gòu)建一個(gè)自由風(fēng)格的軟件項(xiàng)目
7瞪慧、配置項(xiàng)目
7.1基本信息
7.2源碼管理
7.3構(gòu)建
添加構(gòu)建步驟->選擇Xcode
- Target:Target和項(xiàng)目中Target的名字一致
- Clean before build:設(shè)為Yes
- Configuration:選擇release(默認(rèn)為release)
- .ipa filename pattern:打包后的文件名字髓考。隨便寫(xiě)一個(gè)
- Output directory:.ipa文件的輸出路徑${WORKSPACE}/build/
添加構(gòu)建步驟->Code signing & OS X keychain options
- 選擇Unlock Keychain
- Keychain Path: ${HOME}/Library/Keychains/login.keychain
- Keychain password:電腦登錄密碼
8、增加構(gòu)建步驟
增加構(gòu)建步驟->選擇Execute shell
上傳到蒲公英
- file:.ipa文件路徑
- uKey:蒲公英上可以看到
- _api_key:蒲公英上可以看到
curl -F "file=@ipa所在路徑" -F "uKey=用戶User Key" -F "_api_key=用戶API Key" http://www.pgyer.com/apiv1/app/upload
參考資料
jenkins+Xcode+蒲公英實(shí)現(xiàn)ipa自動(dòng)打包發(fā)布全攻略
Jenkins+GitHub+Xcode+fir搭了一個(gè)持續(xù)集成環(huán)境
手把手教你利用Jenkins持續(xù)集成iOS項(xiàng)目