Custom podspec clone works, but installation of pod fails

ios
#1

We have a custom podspec repo which get cloned via ssh through a source command in the Podfile.
When pod install is invoked, the installation of the private pod fails because it’s attempting to use http(s). Any tips?

0 Likes

#2

Just before someone points this article out:
http://devcenter.bitrise.io/faq/adding-projects-with-submodules/

It doesn’t explain the problem I’m experiencing.

0 Likes

#3

Hi @bsarrazin,

Our CocoaPods Installer step does not change anything in your configs, it pretty much just runs pod install. So if you see HTTPS urls in pod install's log which should not be there then that’s related to something in your pod config - I’d suggest you to follow the first section of this local debug guide: How to debug your build locally / “It works on my Mac/PC but not on bitrise.io”

  1. Do a clean git clone, into a new directory
  2. Then do pod install there

and check its log whether you see those https URLs.

If that wouldn’t help please copy paste the related build’s bitrise.io URL and we’ll look into it ASAP! :slight_smile:

0 Likes

#4

hey @viktorbenei sorry for the delay
take a look at this build:

The podspec repo is private. Can you help?

0 Likes

#5

Let me try these steps.

0 Likes

#6

@viktorbenei it works fine locally with Bitrise CLI.
I’ve enabled Bitrise Support on the app, let me know what else I can do to help?

0 Likes

#7

@viktorbenei bump
definitely a high priority for our team at the moment
am happy to make time to get on a call if you wish, let me know!

0 Likes

#8

@bsarrazin checked the log:

[10:04:57]: ▸ e[0;35;49mCloning spec repo `X` from `https://github.com/X/ios-podspecs.git`e[0m
[10:04:57]: ▸ e[0;35;49m[!] Unable to add a source with url `https://github.com/X/ios-podspecs.git` named `X`.e[0m

This issue is mentioned in the submodule docs you linked (http://devcenter.bitrise.io/faq/adding-projects-with-submodules/), specifically the first blue box (Use SSH URLs everywhere) on the page.

In short, if you use SSH keys for auth (which you do) then you should use the SSH git clone URLs for every private repo, including pod spec & pod repos. When you use a https:// git clone URL git itself will ignore SSH auth.

Please use the git@... style SSH git clone URL instead of the https:// one.

Alternatively you can also switch to auth for https, but your current setup uses SSH key based auth.

Let me know if you’d have any questions! :slight_smile:

0 Likes

#9

Another option: reconfigure git to use SSH git clone URLs for github instead of HTTPS ones

Note: this affects every git clone after running this git config!

E.g. using a Script step:

git config --global url."git@github.com:".insteadOf "https://github.com/"

This instructs git that in every case when the git clone URL starts with https://github.com/ it should replace it with git@github.com: before contacting the server.

1 Like

#10

I did try using ssh before and it failed. Tried again, failed.
That last suggest about a script step did the trick!
Thank you @viktorbenei, much much much appreciation for your help!

1 Like

#11

Any time :wink:

0 Likes

#12

This helped me as well, thank you SO much!

1 Like