Git resource, https clone, and username and password auth using git resource

Hi,

The below is how I am doing an initial checkout from git and syncing
every chef run. I am using using a bare bones ubuntu AMI with git and
SSH keys authed with git hub. All works find using this method.

git “/home/ubuntu/workspace/MyRepo” do
repository "git@github.com:mycomoany/MyRepo.git"
reference branch_name
action :sync
user "root"
end

I prefer to use https with username and password auth for git with
https clone. Per the docs, it seems that that the git resource has
usename and password for the repo. Only SVN. I can do a python
script using pexpect for auth but that seems overkill. Anyway
to use the git resource?

Thanks

I'd try embedding the username and password in the git url, i.e. "https://user:passwd@github.com/mycompany/MyRepo.git".

Cheers,

Jeremy

On Tuesday, June 19, 2012 at 11:25 PM, David Montgomery wrote:

Hi,

The below is how I am doing an initial checkout from git and syncing
every chef run. I am using using a bare bones ubuntu AMI with git and
SSH keys authed with git hub. All works find using this method.

git "/home/ubuntu/workspace/MyRepo" do
repository "git@github.com (mailto:git@github.com):mycomoany/MyRepo.git"
reference branch_name
action :sync
user "root"
end

I prefer to use https with username and password auth for git with
https clone. Per the docs, it seems that that the git resource has
usename and password for the repo. Only SVN. I can do a python
script using pexpect for auth but that seems overkill. Anyway
to use the git resource?

Thanks