Is there a way to use private git repository with Berkshelf
Asked Answered
V

1

6

I created a cookbook named foo, and want to use with Berkshelf.

I wrote like this in Berksfile:

cookbook 'foo', git: 'https://bitbucket.org/ironsand/cookbook-foo.git'

Then vendor the cookbook to cookbooks directory, but it failed with error like this:

berks vendor cookbooks
Resolving cookbook dependencies...
Fetching 'foo' from https://bitbucket.org/ironsand/cookbook-foo.git (at master)
Username for 'https://bitbucket.org':

How can I tell ssh username and key to Berkshelf? Of course my user have right to access the git repository.

Volkman answered 6/10, 2014 at 10:39 Comment(4)
If you want to use the "ssh username and key", have you tried specifying an SSH URL ?Flapdoodle
I want to know how to specify the ssh URL with berks command.Volkman
From bershelf documentation: "If you need to reference a private Github repository then you should use the :git location with the ssh protocol." So see @Flapdoodle link in SSH URL...Heptagonal
Oh, now I got what @Flapdoodle means, thanks!Volkman
E
14

If you want to use ssh authentication with your git provider, you need to use an SSH URL. Try something like this:

cookbook 'foo', git: '[email protected]/ironsand/cookbook-foo.git'

That will use your SSH key to authenticate.

Exteriorize answered 6/10, 2014 at 13:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.