8

I just installed the new OS X Server with Xcode CI (http://www.apple.com/osx/server/features/#xcode-server).

I have successfully setup CI for my project, but a submodule of the main git repo is very big (it contains version-controlled images, not code).

For performance and space-related reasons I'd like the CI to use a shallow clone instead of a full clone when getting the submodule. Is there a way to configure the CI to do that?

Or is there an alternative way to speed up the process?

x10
  • 3,820
  • 1
  • 24
  • 32

1 Answers1

0

Shallow submodules are possible with git, the problem is with Xcode CI.

Using git to store large binary images is anti-pattern, so it might never be an optimal fit behaviorally. For Xcode's sake, ideally you would not use git at all for this purpose, and just script into CI that the build process retrieves a single image (for example, via a rake or gradle task, wget, curl, scp, etc.). If it is really an image target, you probably have the ability to reference it, like this jar file:

https://github.com/projecthydra/hydra-jetty/blob/master/solr/lib/solr-analysis-extras-4.9.0.jar

The CI is not interested in the availability of other possible states for the target, or the revision history. It just wants to fulfill the dependency.

If you must use submodule, you could set up your own slimmed internal repo target called [that_submodule]_current that just has the single state you want. Blow it away and replace it as needed.

Note that Xcode apparently has a detached submodule head bug, so that suggests it will be some time before they handle other slightly more exotic submodule options like --depth.

Community
  • 1
  • 1
Joe Atzberger
  • 3,079
  • 1
  • 18
  • 16
  • Hi, we're talking about the cocos2d repository. It's not binary, it just has several thousand commits. – x10 Sep 04 '14 at 08:23
  • So it's not version controlled images? Several thousand commits of code is fairly common. What you want is: `git clone --depth 1 --branch master --single-branch ` But Xcode is broken for `--depth`. – Joe Atzberger Sep 06 '14 at 00:42
  • Yes, that's exactly what I want. And that's what I do normally. My question is "How do I make the xCode server do that?" – x10 Sep 06 '14 at 18:01
  • And to be absolutely clear, because this question was asked a while ago and confusion may occur - my project has several submodules. One is the art repo, which contains "version controlled images". Another is the cocos2d library, which does not. Both are submodules and both take a long time to checkout. – x10 Sep 06 '14 at 18:02
  • Unfortunately, it appears that Xcode currently cannot handle `--depth` (or any detached head) through its normal configuration channels. I don't have a workaround for that. It's a seriously limiting bug. – Joe Atzberger Sep 08 '14 at 22:18