問題描述
我正在為我們的 iphone 應用程序設置一個自動化的夜間構建服務器,并尋求有關哪些有效和哪些無效的建議.
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.
基本上,至少每晚運行所有單元測試并將新的臨時構建發布到我們的內部網站.
Basically, something that at least nightly runs all the unit tests and publishes a new adhoc build to our internal website.
所有開發人員都使用筆記本電腦(它會在一夜之間關閉),所以我正在考慮使用專用的 Mac Mini 來執行此操作.
All the developers use laptops (which'll be off overnight), so I'm considering getting a dedicated Mac Mini to do this.
我不確定我應該獲得標準 Mac OS X 還是服務器版本.
I'm not sure if I should get standard Mac OS X or the server edition.
至少在第一次嘗試時,我正在考慮僅使用從 crontab 運行的簡單 shell 腳本來完成實際工作.將來一個完整的持續集成服務器(hudson 等)會很好.
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.
我已經通過搜索找到了一些文章,雖然它們很簡短:
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/
而且這個 stackoverflow 問題也有一些有用的軟件信息(雖然它現在已經兩年了):
and also this stackoverflow question has some useful software info (though it's two years old now):
Xcode 項目的持續集成?
如果人們可以就如何設置構建服務器和任何潛在問題提供任何指導,我們將不勝感激.
Any guidance people can give on how they've setup a build server and any potential issues would be greatly appreciated.
謝謝!
約瑟夫
推薦答案
Hudson(或其分支 Jenkins) 確實不難設置;這是我們內部使用的.我們不只是從中運行 iphone 構建 - 事實上,只有一個單獨的 mac mini 設置用于 iphone 構建,而且它是一個相對較新的添加.一段時間以來,我們已經為其他不同平臺安裝了六個其他奴隸.
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 頁面來感受一下它是多么容易設置.(這是賣給我的東西之一;它真的很容易上手,但仍然可配置、可擴展且功能強大,足以讓我們在過去幾年中不斷擴展.它取代了一堆非常笨拙的手-滾動的腳本和程序,盡管是作者,但我很高興看到安息.)
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.)
我們在強大的 Mac OSX 服務器上運行 hudson 后端,但沒有理由不能在任何地方(linux、windows、mac)運行它.
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).
至于配置構建——項目配置中大概有6行shell腳本,主要是調用xcodebuild
并傳遞-project
和-配置
參數.
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
我們還沒有設置從屬服務器作為服務運行——這在 TODO 列表中.現在,只要我們重新啟動它所在的 mini,我們就通過 JNLP 啟動它.
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 負責為我們記住 https auth 信息.
Repository is SVN, and the hudson master takes care of remembering the https auth info for us.
我們積極使用 Email-ext 插件,并且有一個構建超時插件和一個審計跟蹤插件,因為有很多其他人在使用該系統,并且一些構建行為不正常.我們對 Warnings 插件和 靜態代碼分析插件,需要用到在更多項目上(我們通常會在構建中將警告作為錯誤,但我們確實在某些項目上使用 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 版本上運行單元測試(真遺憾!),我們只是使用 hudson 內置的普通歸檔工件"功能來存儲版本.這些可以通過授權用戶通過 hudson Web 界面訪問.我毫不懷疑在框架內運行單元測試對您來說并不難.
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 有關——與 hudson 完全無關,更多的是我們的內部網絡基礎設施.mini 對我來說有點慢——我們通常運行相當強大的構建奴隸,理論認為快速的自動構建周轉是一件好事.出于這個原因,mini 可能會在某個時候獲得 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.
這篇關于為 iphone 應用程序設置自動構建服務器的最佳實踐?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!