spox / batali

Light weight cookbook resolver
https://spox.github.io/batali
Other
32 stars 6 forks source link

Git private repo error #37

Closed phoolish closed 9 years ago

phoolish commented 9 years ago

Is there additional configuration necessary to resolve private git repositories?

Batali file:

Batali.define do
  source 'https://supermarket.chef.io'
  cookbook 'repo', git: 'git://github.com/org/repo.git'
end

Output from batali resolve:

[ERROR]: Reason - git  clone '--' 'git://github.com/org/repo.git' '/Users/username/.batali/cache/git/Z2l0Oi8vZ2l0aHViLmNvbS90YWJsZXhpL2NoZWYtY29yZS5naXQ='  2>&1:Cloning into '/Users/username/.batali/cache/git/Z2l0Oi8vZ2l0aHViLmNvbS90YWJsZXhpL2NoZWYtY29yZS5naXQ='...
fatal: remote error: 
  Repository not found.
ERROR: Git::GitExecuteError: git  clone '--' 'git://github.com/org/repo.git' '/Users/username/.batali/cache/git/Z2l0Oi8vZ2l0aHViLmNvbS90YWJsZXhpL2NoZWYtY29yZS5naXQ='  2>&1:Cloning into '/Users/username/.batali/cache/git/Z2l0Oi8vZ2l0aHViLmNvbS90YWJsZXhpL2NoZWYtY29yZS5naXQ='...
fatal: remote error: 
  Repository not found.
chrisroberts commented 9 years ago

Hi! Private git repos will need a different syntax:

cookbook 'repo', git: 'git@github.com:org/repo.git'

or

cookbook 'repo', git: 'https://github.com/org/repo.git'
phoolish commented 9 years ago

Thanks for the fast response!

Hmm, it did resolve this time, but I had to enter a user/pass and requires generating a token (MFA enabled account) and reprompts for all dependencies.

Is there no way to use an ssh_key config or an ENV value?

luckymike commented 9 years ago

It's Ruby, so you should be able to do an ENV.fetch(key)

phoolish commented 9 years ago

@luckymike could you elaborate?

luckymike commented 9 years ago

ENV.fetch('foo') will return the ENV variable 'foo', so you can use that within the config to return an ENV variable. Not knowing what specifically you'd like to return, I'm not sure what sort of additional detail would help.

phoolish commented 9 years ago

Sorry, I should have been more specific. I know how to return ENV var into a ruby file. Do you then set the user/pass in the Batali file?

phoolish commented 9 years ago

@luckymike Went way of track of the original question. I think I've sorted it out. Thanks for the patience.