Is it possible to use a custom CocoaPods repo without timing out on the clone?

We are required by internal security initiatives to use Artifactory in between us and CocoaPods.

We’ve added our custom CocoaPods repo in the Podfile.

As part of our build we added a script step that does a pod repo-art add command to add the remote. This causes a clone that takes over 45 minutes to execute, and then the build times out.

Is it possible to execute this faster? Obviously the machines cache the regular CocoaPods specs repo. If we could just get the execution to complete, we could use the cache step to save the repo for next time.

Thank you!

That seems incredibly long. How large is your own pods repo? Ideally it should only include the pods you want to allow, in which case it should be pretty fast to clone.

Or, can it be that the clone hangs? E.g. if it’s a private git repo and you use the HTTPS git clone URL (instead of the SSH git clone url) I think cocoapods might hang waiting for a username + password for auth. Not sure about this, maybe cocoapods does have built in handling for this, git by default definitely asks for username + psw for HTTPS git clone URLs if the repo is not public.

It’s actually a clone of the entire Cocoa Pods spec repo. The rationale is that a developer who wants to introduce a new Cocoa Pod shouldn’t have access to Artifactory to whitelist it. So the repo has everything in it.

And it’s definitely not hanging or waiting for auth. You can follow the log and watch it creating all the objects, and then it’s killed after 45 minutes.

The issue with this is that the main CP spec repo is incredibly large by now; it includes the whole history of the spec including every pod version change etc.

I don’t think this is a bad solution, to have a full copy of it, but maybe don’t clone the whole history, just copy the content of the spec, unless you actually need the history for some reason.

Unfortunately the pod repo-art command doesn’t give me a choice. It does this:

Retrieving index from `https://pagerduty.jfrog.io/pagerduty/api/pods/pods-remote` into local spec repo `pods-remote`
Initialized empty Git repository in /Users/vagrant/.cocoapods/repos-art/pods-remote/.git/
[master (root-commit) 04bf702] Artifactory repo init
 168232 files changed, 6359413 insertions(+)
 create mode 100644 .artpodrc
 create mode 100644 Specs/!ProtoCompiler-gRPCPlugin/0.14.0/!ProtoCompiler-gRPCPlugin.podspec.json
 create mode 100644 Specs/!ProtoCompiler-gRPCPlugin/1.0.0-pre1.1/!ProtoCompiler-gRPCPlugin.podspec.json

and just goes on and on.

Even if I do a shallow clone of the CocoaPods main repo, it still takes too much time, and would eat in to the 45 minutes allotted to my build.

Just downloaded the spec repo - https://github.com/CocoaPods/Specs - it’s about 150MB. With no history that shouldn’t be an issue, unless the server you download it from is slow.

Not sure if that’s a possibility with Artifactory, but can you download it as a ZIP? E.g. like the GitHub download as ZIP feature. Or maybe expose it as a ZIP somewhere?

Thanks, I’m going to take this up with Artifactory. It shouldn’t be this difficult. :slight_smile:

1 Like

Let us know how it goes or if we can help with anything! :wink: