Apple CI/Xcode 服务和 Jenkins [英] Apple CI / Xcode Service and Jenkins

查看:23
本文介绍了Apple CI/Xcode 服务和 Jenkins的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法/插件将新的 Xcode 服务和/或新的 Apple CI 与 Jenkins 集成?

Is there a way/plugin to integrate the new Xcode service and/or the new Apple CI with Jenkins?

通过 ssh 连接 Jenkins 服务器 + OSX 构建从站的一个主要问题是 单元测试不起作用,因为 iOS 模拟器需要一个图形环境此配置中不存在.

A main issue with having a Jenkins server + an OSX build slave connected via ssh is that Unit Tests do not work, as the iOS Simulator needs a graphical environment which is not present in this configuration.

我希望可以将 Xcode 服务(支持单元测试)与 Jenkins 集成.

I hope that it is possible to integrate the Xcode service (which supports Unit Testing) with Jenkins.

可能使用 Apple CI 就足以满足我的需求,但这个问题的目的是 Xcode 服务与 Jenkins 的集成.

It could be that using the Apple CI will be enough for my needs, but this question aims at the integration of the Xcode service with Jenkins.

我有使用 现有 Xcode Jenkins 插件的经验,但它似乎不支持全新的 Xcode 服务或新的 Apple CI.我特别热衷于通过 CI 进行单元测试(在使用旧方法的 ssh 会话中无法正常工作).

I have experience with the existing Xcode Jenkins plugin, but it seems not to support the brand new Xcode service or the new Apple CI. I'm especially keen on unit testing via CI (which did not work properly over a ssh session with the old way).

我想了解以下当前无法与 Jenkins 和 ssh 连接的构建从站一起使用的问题:

I'd like info on the following issues currently not working with Jenkins and an ssh connected build slave:

  • 无头系统上的单元测试
  • 使用 Frank 或类似方法进行验收测试
  • 自动配置配置文件更新(Apple CI 会这样做)
  • Unit Tests on a headless system
  • Acceptance tests with Frank or similar
  • Automatic Provisioning Profile updating (Apple CI does that)

关于目前在 Jenkins 和 ssh 连接的构建从属设备上可以正常工作并且仍然应该与 Xcode 服务集成一起工作的信息:

And info on things that currently do work fine with Jenkins and an ssh connected build slave and still should work with an Xcode service integration:

  • 不同构建配置(发布、调试、TestFlight)/方案的构建
  • 内部版本号自动递增
    • (使用 Jenkins,我可以将项目中的内部版本号设置为 ${BUILD_NUMBER},然后 Jenkins 根据其内部版本号设置此环境变量.当 Apple CI 最有可能进行构建时将改为设置内部版本号.)
    • 处理/同步 Jenkins 和 Jenkins 之间的内部版本号苹果CI
    • Builds of different build configurations (Release, Debug, TestFlight) / schemes
    • Automatic Build number increment
      • (With Jenkins I can set the build number in my project to ${BUILD_NUMBER}, and Jenkins sets this environment variable according to its build number. When the Apple CI does the builds most probably it will set the build number instead.)
      • Handling/synchronization of Build number between Jenkins & Apple CI
      • 例如将作业上传到 TestFlight
      • 我不确定是 Apple CI == Xcode 服务 还是 Apple CI 只是使用 Xcode 服务.在后一种情况下,Xcode 服务就像一个智能构建奴隶,詹金斯也许可以使用它来进行构建和测试,但自己管理构建号和产品.
      • 我知道 Apple CI 是一个单独的 CI,将多个 CI 相互集成并不是最简单或最有用的方法.我只是担心 Apple CI 不够灵活,无法满足我的需求(见上文),而且 Jenkins 的旧方法存在一些问题(见上文).
      • I'm not sure whether the Apple CI == Xcode service or if the Apple CI just uses the Xcode service. In the latter case the Xcode service just would be like an intelligent build slave, and Jenkins maybe could use that to do builds and tests, but manage build numbers and products by itself.
      • I'm aware that the Apple CI is an separate CI, and integrating several CIs with each other is not the most easy or useful way to go. I just fear that the Apple CI is not flexible enough for my needs (see above), and that the old way with Jenkins bears some problems (see above).

      推荐答案

      我相信你将不得不选择 jenkins 或 xcode 服务器,而不是两者.我对 xcode server 不太了解,但我对 jenkins 和 xcode 5 了解.

      I believe you are going to have to choose either jenkins or xcode server, not both. I don't know much about xcode server, but I do know about jenkins and xcode 5.

      使用不同配置构建:

      在xcode插件中,可以设置使用的scheme.

      In the xcode plugin, you can set the scheme to use.

      内部版本号自动递增

      我在我的 jenkins 作业中添加了一个名为 XCODEBUILDNUMBER 的参数.每当我开始构建时,我只需将构建号从我的 xcode 项目中复制出来(我手动递增它.我的看起来像 080813A)并将其粘贴到 XCODEBUILD 参数中.我用它来命名我的输出文件等.有一些 jenkins 插件可以自动增加你的内部版本号,但它们不集成,也不与 xcode 同步.

      I added a parameter to my jenkins job called XCODEBUILDNUMBER. And whenever I start a build, I simply copy the build number out of my xcode project (I increment it manually. Mine looks like 080813A) and paste it into the XCODEBUILD parameter. I use this to name my output files, etc. There are plugins for jenkins that can automatically increment your build number, but they don't integrate, or sync with xcode.

      处理/同步 Jenkins 和 Jenkins 之间的内部版本号苹果CI

      正如我之前所说,我不知道同步内部版本号的方法,但我只是想到了一个可能的解决方案.您可以使用命令行工具 plistbuddy,在 info.plist 中设置构建号,作为 jenkins 作业中的构建步骤.

      As I said before, I don't know of a way to sync the build numbers, but I just thought of a possible solution. You could use the command line tool plistbuddy, to set the build number in your info.plist, as a build step in your jenkins job.

      单元测试

      我还没有成功地使单元测试与 Xcode5 一起工作,但我知道 jenkins 的 xcode 插件支持它.我相信项目设置中缺少Test After Build"键可能与此有关.如果你让它工作,我很想知道.(我也热衷于制作这项工作)

      I have not successfully made unit tests work with Xcode5, but I know that the xcode plugin for jenkins supports it. I believe that the absence of the "Test After Build" key in the project settings may have something to do with it. If you make it work, i'd love to know. (I am also keen on making this work)

      验收测试

      据我所知,Frank 是一个命令行工具.您可以轻松地将它集成到您​​的 Jenkins 工作中,并且我相信如果您的测试没有通过,它会导致构建失败.

      From what I can tell, Frank is a command line tool. You can easily integrate it into your Jenkins job, and I believe that it will fail the build if your tests don't pass.

      从不同的 Jenkins Jobs 访问 Apple CI 的构建产品

      不完全确定您的意思,但使用 jenkins,您可以归档您的构建产品(一个 .ipa),以便以后下载并上传到 testflight 等服务.同样,我对 Xcode Server (CI) 了解不多.

      Not completely sure what you mean, but with jenkins you can archive your build product (a .ipa), for later download and upload to a service like testflight. Again, I don't know much about Xcode Server (CI).

      构建备份

      正如我之前所说,jenkins 可以归档您的构建产品.另外,我在构建产品目录中使用了 ${BUILD_NUMBER} 变量,因此每个构建都有不同的目录.这个目录也备份到我的 Time Machine,重要的构建复制到我的 web 目录.

      As I said before, jenkins can archive your build product. Also, I use the the ${BUILD_NUMBER} variable in my build products directory, so I have a different directory for each build. This directory is also backed up to my Time Machine, and important builds copied to my web directory.

      基于 git push 自动构建到特定分支

      使用 jenkins git 插件,您可以让 jenkins 在您指定的时间间隔内轮询您的 scm,并可以在更改时触发构建.

      With the jenkins git plugin, you can make jenkins poll your scm in a interval specified by you, and can trigger a build on a change.

      电子邮件通知

      我确信有一个插件可以解决这个问题.(当构建失败/成功时向您发送电子邮件.事实上,这可能是内置的)

      I am sure that there is a plugin for this. (that emails you when a build failed/succeeded. in fact, this may be built-in)

      即将结束

      xcode CI 是一个完全独立的 CI,可能很难与 jenkins 集成.就个人而言,我会推荐 jenkins 仅仅是因为它的可扩展性.抱歉,我对 Xcode Server 了解不多.

      The xcode CI is a full independent CI, that may be hard to integrate with jenkins. Personally, I would recommend jenkins simply due to its extendability. Sorry I don't know much about Xcode Server.

      这篇关于Apple CI/Xcode 服务和 Jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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