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

时间:2022-09-06 20:55:50

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. In the future a full continuous integration server (hudson etc) would be good.

至少在第一次尝试时,我考虑使用一个从crontab运行的简单shell脚本来完成实际的工作。在未来,一个完整的持续集成服务器(hudson等)将会很好。

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 * question has some useful software info (though it's two years old now):

还有这个*的问题有一些有用的软件信息(虽然已经有两年了):

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

约瑟夫

3 个解决方案

#1


14  

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.

Hudson(或者它的fork Jenkins)真的不难建立;这是我们在内部使用的。我们不只是运行iphone的构建——事实上,只有一个单独的mac mini是为iphone构建的,而且这是一个相对较新的添加。一段时间以来,我们已经有6个其他的奴隶在那里为其他平台服务。

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.)

你可以通过在Meet Hudson页面上的“测试驱动”链接来使用它,感受一下设置起来有多容易。(这是卖给我的东西之一;它确实很容易开始,但仍然是可配置的、可扩展的、强大的,足以使我们在过去几年中不断扩展。它取代了一大堆手工编写的脚本和程序,尽管我是它的作者,但我还是很高兴地看到它能安息。

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).

我们的hudson后台运行在一个健壮的Mac OSX服务器上,但是没有理由你不能在任何地方运行它(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并传递it -项目和-配置参数。

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. For now we just launch it via JNLP whenever we reboot the mini it's on.

我们还没有设置要作为服务运行的从服务器——这在TODO列表中。现在,只要重新启动mini就可以通过JNLP启动它。

Repository is SVN, and the hudson master takes care of remembering the https auth info for us.

储存库是SVN, hudson master负责为我们记住https auth信息。

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.

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

我们目前没有在iphone的任何版本上运行单元测试(真可惜!),我们只是使用hudson内置的普通“归档工件”功能来存储构建。这些可以通过hudson web界面通过授权用户访问。毫无疑问,在框架中运行单元测试对您来说并不困难。

</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. 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.

我们唯一真正的问题与AFP和mac mini上的SMB有关——与hudson没有任何关系,更多的是我们的内部网络基础设施。mini在我的口味上有点慢——我们通常运行相当健壮的构建奴隶理论,快速的自动构建是一件好事。由于这个原因,mini可能会在某个时候被授予SSD。

#2


6  

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. Or actually its not new, but its integrated support for Mac/IOS builds is new :)

我意识到这个线程上次更新已经有一段时间了,但是从那时起我遇到了一个新的持续集成(CI)服务器。或者实际上它不是新的,但它对Mac/IOS构建的集成支持是新的:)

Its the TeamCity product from JetBrains available at http://www.jetbrains.com/teamcity/

它是来自JetBrains网站http://www.jetbrains.com/teamcity/的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 :)

希望这有助于:)

#3


0  

One new option is Xcode 5 combined with Mac OS X 10.9 (Mavericks) and OS X Server. OS X Server now has an Xcode server component which is good for running automated tests.

一个新选项是Xcode 5与Mac OS X 10.9 (Mavericks)和OS X服务器结合在一起。OS X服务器现在有一个Xcode服务器组件,可以很好地运行自动测试。

It can do:

它还可以这样:

  1. Build (+check for warnings)
  2. 构建(+检查警告)
  3. Analyze (ie. clang static analysis)
  4. 分析(即。奏鸣曲静态分析)
  5. Run tests on iOS simulator + all connected devices connected to it with USB
  6. 在iOS模拟器上运行测试+与USB连接的所有连接设备。

For running tests on devices, it beats jenkins/hudson for simplicity and ease of setup by a huge margin. 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.

对于在设备上运行测试,它比jenkins/hudson的简单性和设置的易用性差很多。然而,Xcode服务器(从Xcode 5.1开始)是完全不可定制的——如果您想添加性能/内存使用/之类的自定义图形,您不能这样做——对于这种功能,jenkins/Hudson要好得多。

#1


14  

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.

Hudson(或者它的fork Jenkins)真的不难建立;这是我们在内部使用的。我们不只是运行iphone的构建——事实上,只有一个单独的mac mini是为iphone构建的,而且这是一个相对较新的添加。一段时间以来,我们已经有6个其他的奴隶在那里为其他平台服务。

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.)

你可以通过在Meet Hudson页面上的“测试驱动”链接来使用它,感受一下设置起来有多容易。(这是卖给我的东西之一;它确实很容易开始,但仍然是可配置的、可扩展的、强大的,足以使我们在过去几年中不断扩展。它取代了一大堆手工编写的脚本和程序,尽管我是它的作者,但我还是很高兴地看到它能安息。

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).

我们的hudson后台运行在一个健壮的Mac OSX服务器上,但是没有理由你不能在任何地方运行它(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并传递it -项目和-配置参数。

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. For now we just launch it via JNLP whenever we reboot the mini it's on.

我们还没有设置要作为服务运行的从服务器——这在TODO列表中。现在,只要重新启动mini就可以通过JNLP启动它。

Repository is SVN, and the hudson master takes care of remembering the https auth info for us.

储存库是SVN, hudson master负责为我们记住https auth信息。

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.

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

我们目前没有在iphone的任何版本上运行单元测试(真可惜!),我们只是使用hudson内置的普通“归档工件”功能来存储构建。这些可以通过hudson web界面通过授权用户访问。毫无疑问,在框架中运行单元测试对您来说并不困难。

</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. 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.

我们唯一真正的问题与AFP和mac mini上的SMB有关——与hudson没有任何关系,更多的是我们的内部网络基础设施。mini在我的口味上有点慢——我们通常运行相当健壮的构建奴隶理论,快速的自动构建是一件好事。由于这个原因,mini可能会在某个时候被授予SSD。

#2


6  

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. Or actually its not new, but its integrated support for Mac/IOS builds is new :)

我意识到这个线程上次更新已经有一段时间了,但是从那时起我遇到了一个新的持续集成(CI)服务器。或者实际上它不是新的,但它对Mac/IOS构建的集成支持是新的:)

Its the TeamCity product from JetBrains available at http://www.jetbrains.com/teamcity/

它是来自JetBrains网站http://www.jetbrains.com/teamcity/的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 :)

希望这有助于:)

#3


0  

One new option is Xcode 5 combined with Mac OS X 10.9 (Mavericks) and OS X Server. OS X Server now has an Xcode server component which is good for running automated tests.

一个新选项是Xcode 5与Mac OS X 10.9 (Mavericks)和OS X服务器结合在一起。OS X服务器现在有一个Xcode服务器组件,可以很好地运行自动测试。

It can do:

它还可以这样:

  1. Build (+check for warnings)
  2. 构建(+检查警告)
  3. Analyze (ie. clang static analysis)
  4. 分析(即。奏鸣曲静态分析)
  5. Run tests on iOS simulator + all connected devices connected to it with USB
  6. 在iOS模拟器上运行测试+与USB连接的所有连接设备。

For running tests on devices, it beats jenkins/hudson for simplicity and ease of setup by a huge margin. 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.

对于在设备上运行测试,它比jenkins/hudson的简单性和设置的易用性差很多。然而,Xcode服务器(从Xcode 5.1开始)是完全不可定制的——如果您想添加性能/内存使用/之类的自定义图形,您不能这样做——对于这种功能,jenkins/Hudson要好得多。