为 iphone 应用程序设置自动构建服务器的最佳实践? [英] Best practice for setting up an automated build server for iphone apps?

查看:35
本文介绍了为 iphone 应用程序设置自动构建服务器的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我们的 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 NorrisEmotional 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 应用程序设置自动构建服务器的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆