問題描述
我正在為我們的 iphone 應(yīng)用程序設(shè)置一個(gè)自動(dòng)化的夜間構(gòu)建服務(wù)器,并尋求有關(guān)哪些有效和哪些無效的建議.
I'm looking to setup an automated nightly build server for our iphone apps, and looking for advice on what works and what doesn't.
基本上,至少每晚運(yùn)行所有單元測試并將新的臨時(shí)構(gòu)建發(fā)布到我們的內(nèi)部網(wǎng)站.
Basically, something that at least nightly runs all the unit tests and publishes a new adhoc build to our internal website.
所有開發(fā)人員都使用筆記本電腦(它會(huì)在一夜之間關(guān)閉),所以我正在考慮使用專用的 Mac Mini 來執(zhí)行此操作.
All the developers use laptops (which'll be off overnight), so I'm considering getting a dedicated Mac Mini to do this.
我不確定我應(yīng)該獲得標(biāo)準(zhǔn) Mac OS X 還是服務(wù)器版本.
I'm not sure if I should get standard Mac OS X or the server edition.
至少在第一次嘗試時(shí),我正在考慮僅使用從 crontab 運(yùn)行的簡單 shell 腳本來完成實(shí)際工作.將來一個(gè)完整的持續(xù)集成服務(wù)器(hudson 等)會(huì)很好.
At least for the first attempt, I'm considering just using a simple shell script run from a crontab to do the actual work. In the future a full continuous integration server (hudson etc) would be good.
我已經(jīng)通過搜索找到了一些文章,雖然它們很簡短:
I've already found a few articles through searching, though they're quite brief:
http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
http://blog.jeffreyfredrick.com/2008/11/27/continuous-integration-for-iphonexcode-projects/
而且這個(gè) stackoverflow 問題也有一些有用的軟件信息(雖然它現(xiàn)在已經(jīng)兩年了):
and also this stackoverflow question has some useful software info (though it's two years old now):
Xcode 項(xiàng)目的持續(xù)集成?
如果人們可以就如何設(shè)置構(gòu)建服務(wù)器和任何潛在問題提供任何指導(dǎo),我們將不勝感激.
Any guidance people can give on how they've setup a build server and any potential issues would be greatly appreciated.
謝謝!
約瑟夫
推薦答案
Hudson(或其分支 Jenkins) 確實(shí)不難設(shè)置;這是我們內(nèi)部使用的.我們不只是從中運(yùn)行 iphone 構(gòu)建 - 事實(shí)上,只有一個(gè)單獨(dú)的 mac mini 設(shè)置用于 iphone 構(gòu)建,而且它是一個(gè)相對(duì)較新的添加.一段時(shí)間以來,我們已經(jīng)為其他不同平臺(tái)安裝了六個(gè)其他奴隸.
Hudson (or its fork Jenkins) is really not hard to set up; it's what we use internally. We don't just run iphone builds from it -- in fact, there's only only one lone mac mini set up for iphone builds, and it's a relatively recent addition. We've had a half-dozen other slaves on it for other different platforms for some time.
您可以通過 Meet 上的試駕"鏈接玩它Hudson 頁面來感受一下它是多么容易設(shè)置.(這是賣給我的東西之一;它真的很容易上手,但仍然可配置、可擴(kuò)展且功能強(qiáng)大,足以讓我們?cè)谶^去幾年中不斷擴(kuò)展.它取代了一堆非常笨拙的手-滾動(dòng)的腳本和程序,盡管是作者,但我很高興看到安息.)
You can play with it through the "Test Drive" link on the Meet Hudson page to get a feel for how easy it is to set up. (This is one of the things that sold me on it; it was really easy to get started with, but still configurable, extensible, and powerful enough to keep us expanding over the last few years. It replaced a really kludgy pile of hand-rolled scripts and programs that, despite being the author of, I was very happy to see laid to rest.)
我們?cè)趶?qiáng)大的 Mac OSX 服務(wù)器上運(yùn)行 hudson 后端,但沒有理由不能在任何地方(linux、windows、mac)運(yùn)行它.
We have the hudson backend running on a beefy Mac OSX server, but there's no reason you couldn't run it pretty much anywhere (linux, windows, mac).
至于配置構(gòu)建——項(xiàng)目配置中大概有6行shell腳本,主要是調(diào)用xcodebuild
并傳遞-project
和-配置
參數(shù).
As for configuring it for building -- it's about 6 lines of shell script in the project configuration, mostly calling xcodebuild
and passing it -project
and -configuration
arguments.
例子:
cd ${WORKSPACE}/Engineering/
set -e
set -v
xcodebuild -project foo.xcodeproj -alltargets -configuration Distribution clean
xcodebuild -project foo.xcodeproj -alltargets -configuration Release clean
xcodebuild -project foo.xcodeproj -alltargets -configuration Debug clean
xcodebuild -project foo.xcodeproj -alltargets -configuration Distribution
xcodebuild -project foo.xcodeproj -alltargets -configuration Release
xcodebuild -project foo.xcodeproj -alltargets -configuration Debug
我們還沒有設(shè)置從屬服務(wù)器作為服務(wù)運(yùn)行——這在 TODO 列表中.現(xiàn)在,只要我們重新啟動(dòng)它所在的 mini,我們就通過 JNLP 啟動(dòng)它.
We haven't set up the slave to run as a service yet -- this is on the TODO list. For now we just launch it via JNLP whenever we reboot the mini it's on.
Repository 是 SVN,hudson master 負(fù)責(zé)為我們記住 https auth 信息.
Repository is SVN, and the hudson master takes care of remembering the https auth info for us.
我們積極使用 Email-ext 插件,并且有一個(gè)構(gòu)建超時(shí)插件和一個(gè)審計(jì)跟蹤插件,因?yàn)橛泻芏嗥渌嗽谑褂迷撓到y(tǒng),并且一些構(gòu)建行為不正常.我們對(duì) Warnings 插件和 靜態(tài)代碼分析插件,需要用到在更多項(xiàng)目上(我們通常會(huì)在構(gòu)建中將警告作為錯(cuò)誤,但我們確實(shí)在某些項(xiàng)目上使用 PC-Lint 和其他工具;在這里匯總和跟蹤輸出非常好).最后是最重要的 Chuck Norris 和 Emotional Hudson 插件.
We actively use the Email-ext plugin, and have a build timeout plugin and an audit trail plugin since there are a lot of other people using the system and some of the builds are not well-behaved. We've experimented briefly with the Warnings plugin and Static Code Analysis plugins as well, need to get those used on more projects (we usually have warnings as errors in builds, but we do use PC-Lint and other tools on some projects; having output aggregated and tracked here is very nice). Finally the all-important Chuck Norris and Emotional Hudson plugins.
我們目前沒有在任何 iphone 版本上運(yùn)行單元測試(真遺憾!),我們只是使用 hudson 內(nèi)置的普通歸檔工件"功能來存儲(chǔ)版本.這些可以通過授權(quán)用戶通過 hudson Web 界面訪問.我毫不懷疑在框架內(nèi)運(yùn)行單元測試對(duì)您來說并不難.
We're currently not running unit tests (shame!) on any of the iphone builds, and we just use the ordinary "Archive the Artifacts" functionality built into hudson for storing builds. These can be accessed via authorized users via the hudson web interface. I've no doubt that it would not be hard for you to run your unit tests within the framework.
</fanboy>
</fanboy>
我們唯一真正的問題與 mac mini 上的 AFP 和 SMB 有關(guān)——與 hudson 完全無關(guān),更多的是我們的內(nèi)部網(wǎng)絡(luò)基礎(chǔ)設(shè)施.mini 對(duì)我來說有點(diǎn)慢——我們通常運(yùn)行相當(dāng)強(qiáng)大的構(gòu)建奴隸,理論認(rèn)為快速的自動(dòng)構(gòu)建周轉(zhuǎn)是一件好事.出于這個(gè)原因,mini 可能會(huì)在某個(gè)時(shí)候獲得 SSD.
Our only real issues have had to do with AFP and SMB on the mac mini -- nothing to do with hudson at all, more just our internal network infrastructure. And the mini is a bit slow for my tastes -- we usually run pretty beefy build slaves on the theory that quick autobuild turnaround is a good thing. The mini may be gifted an SSD for this reason at some point.
這篇關(guān)于為 iphone 應(yīng)用程序設(shè)置自動(dòng)構(gòu)建服務(wù)器的最佳實(shí)踐?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!