简体   繁体   English

为iphone应用程序设置自动构建服务器的最佳实践?

[英]Best practice for setting up an automated build server for iphone apps?

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. 我正在寻找为我们的iPhone应用程序设置自动夜间构建服务器,并寻找有效和无效的建议。

Basically, something that at least nightly runs all the unit tests and publishes a new adhoc build to our internal website. 基本上,至少每晚运行所有单元测试并向我们的内部网站发布新的特殊构建。

All the developers use laptops (which'll be off overnight), so I'm considering getting a dedicated Mac Mini to do this. 所有开发人员都使用笔记本电脑(将在一夜之间关闭),因此我正在考虑购买专用的Mac Mini来实现这一目标。

I'm not sure if I should get standard Mac OS X or the server edition. 我不确定我是否应该购买标准的Mac OS X或服务器版本。

At least for the first attempt, I'm considering just using a simple shell script run from a crontab to do the actual work. 至少对于第一次尝试,我正在考虑使用从crontab运行的简单shell脚本来完成实际工作。 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://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson

http://blog.jeffreyfredrick.com/2008/11/27/continuous-integration-for-iphonexcode-projects/ http://blog.jeffreyfredrick.com/2008/11/27/continuous-integration-for-iphonexcode-projects/

and also this stackoverflow question has some useful software info (though it's two years old now): 而且这个stackoverflow问题有一些有用的软件信息(虽然现在已经两年了):

Continuous Integration for Xcode projects? Xcode项目的持续集成?

Any guidance people can give on how they've setup a build server and any potential issues would be greatly appreciated. 人们可以提供有关他们如何设置构建服务器以及任何潜在问题的任何指导,我们将不胜感激。

Thanks! 谢谢!

Joseph 约瑟夫

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. 我们不只是从它运行iphone构建 - 实际上,只有一个单独的mac mini设置用于iphone构建,而且它是一个相对新近的添加。 We've had a half-dozen other slaves on it for other different platforms for some time. 一段时间以来,我们已经为其他不同的平台安装了六个其他奴隶。

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. 您可以通过Meet Hudson页面上的“Test Drive”链接进行播放,以了解设置的简便程度。 (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.) (这是卖给我的东西之一;它很容易上手,但仍然可配置,可扩展,功能强大,足以让我们在过去几年中不断扩展。它取代了一堆真正的手 - 滚动的脚本和程序,尽管是作者,我很高兴看到安息。)

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). 我们在一个强大的Mac OSX服务器上运行hudson后端,但没有理由你不能在任何地方运行它(linux,windows,mac)。

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. 至于为构建配置它 - 在项目配置中大约有6行shell脚本,主要是调用xcodebuild并传递它-project-configuration参数。

Example: 例:

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

We haven't set up the slave to run as a service yet -- this is on the TODO list. 我们还没有将slave设置为作为服务运行 - 这是在TODO列表中。 For now we just launch it via JNLP whenever we reboot the mini it's on. 现在我们只要重新启动mini就可以通过JNLP启动它。

Repository is SVN, and the hudson master takes care of remembering the https auth info for us. 存储库是SVN,哈德森主人负责记住我们的https身份验证信息。

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. 我们积极使用Email-ext插件,并有一个构建超时插件和审计跟踪插件,因为有很多其他人使用该系统,并且一些构建不是很好。 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). 我们已经对Warnings插件和静态代码分析插件进行了简单的实验,需要在更多项目中使用它们(我们通常在构建中将警告视为错误,但我们在某些项目中使用PC-Lint和其他工具;具有输出聚合和跟踪这里是非常好的)。 Finally the all-important Chuck Norris and Emotional Hudson plugins. 最后是最重要的Chuck NorrisEmotional Hudson插件。

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. 我们目前没有在任何iphone版本上运行单元测试(羞耻!),我们只是使用hudson内置的普通“归档工件”功能来存储构建。 These can be accessed via authorized users via the hudson web interface. 这些可以通过hudson Web界面通过授权用户访问。 I've no doubt that it would not be hard for you to run your unit tests within the framework. 我毫不怀疑你在框架内运行单元测试并不困难。

</fanboy> </变形金刚迷>

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. 我们唯一真正的问题与mac mini上的AFP和SMB有关 - 与hudson完全无关,更多的是我们的内部网络基础设施。 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. 而mini对我的口味来说有点慢 - 我们通常运行相当强壮的构建奴隶,因为快速自动转换是一件好事。 The mini may be gifted an SSD for this reason at some point. 出于这个原因,迷你可能会在某种程度上被赋予SSD。

I realize it has been a while since this thread was last updated, but I have come across a new continous integration (CI) server since then. 我意识到自从这个线程上次更新以来已经有一段时间了,但从那时起我就遇到了一个新的连续集成(CI)服务器。 Or actually its not new, but its integrated support for Mac/IOS builds is new :) 或者实际上它不是新的,但它对Mac / IOS构建的集成支持是新的:)

Its the TeamCity product from JetBrains available at http://www.jetbrains.com/teamcity/ JetBrains的TeamCity产品可在http://www.jetbrains.com/teamcity/获得

We use it successfully at client I work for for building Java projects, but we will also go for a setup for IOS builds as that is becoming a greater part of our product range. 我们在我为建立Java项目工作的客户端成功使用它,但我们也将为IOS构建设置,因为它正在成为我们产品系列的更大部分。

Its fairly easy to setup and can run of any platform, but the buildagent must run a Mac computer. 它相当容易设置并且可以运行任何平台,但构建者必须运行Mac计算机。

Hope this helps :) 希望这可以帮助 :)

One new option is Xcode 5 combined with Mac OS X 10.9 (Mavericks) and OS X Server. 一个新选项是Xcode 5与Mac OS X 10.9(Mavericks)和OS X Server相结合。 OS X Server now has an Xcode server component which is good for running automated tests. OS X Server现在有一个Xcode服务器组件,适合运行自动化测试。

It can do: 它可以做到:

  1. Build (+check for warnings) 建立(+检查警告)
  2. Analyze (ie. clang static analysis) 分析(即铿锵静态分析)
  3. Run tests on iOS simulator + all connected devices connected to it with USB 在iOS模拟器上运行测试+使用USB连接到它的所有连接设备

For running tests on devices, it beats jenkins/hudson for simplicity and ease of setup by a huge margin. 为了在设备上运行测试,它比jenkins / hudson更加简单,易于设置。 However the Xcode server (as of Xcode 5.1) is completely uncustomisable - if you want to add custom graphing of performance/memory usage/whatever, you can't - for that kind of power, jenkins/Hudson are far better. 然而,Xcode服务器(从Xcode 5.1开始)是完全不可能的 - 如果你想添加性能/内存使用/自由的自定义图形,你不能 - 为了那种力量,jenkins / Hudson要好得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM