Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods - Specify Source Repo Username

Using Cocoapods v0.34.4

My Podfile contains the following

source 'https://bitbucket.org/MyRepo/My-podspecs.git'
source 'https://github.com/CocoaPods/Specs.git'

When I run pod install I need to specify a username/password for my bitbucket account. This is fine when I am running locally, however I am also running this as part of a Continuous Integration build with XCode Server and XCode 6. On XCode Server the pod install command fails because it cannot access bitbucket without my credentials.

Is it possible to add my credentials to the Podfile or any other way to tell Cocoapods the credentials for the bitbucket source repo?

like image 584
Brian Boyle Avatar asked Oct 24 '14 11:10

Brian Boyle


1 Answers

You can use the Bitbucket SSH URL instead of the https URL, and set up passwordless SSH by using an SSH key.

Change your Podfile:

source '[email protected]:MyRepo/My-podspecs.git'

And follow BitBucket's instructions here to set up an SSH key and add it to your Bitbucket account. Make sure you give an empty password when creating your key/identity. For instance, in step 3.4 of their instructions for OSX/Linux, just press enter twice.

like image 164
sgvd Avatar answered Sep 29 '22 21:09

sgvd