【发布时间】:2018-06-07 11:20:30
【问题描述】:
如何使用厨师食谱克隆 aws codecommit 存储库?
我尝试安装 AWS CLI 并添加具有 codecommit 访问权限的凭证,然后使用 chef 的 git 资源来克隆 repo。但它失败,无法读取“https://git-codecommit.us-east-1.amazonaws.com”的用户名。
git "/home/ubuntu/lead_intake" do
repository node[:app_name][:git_repository]
action :sync
end
当尝试从命令行克隆时,它可以工作。
帮助将不胜感激
【问题讨论】:
-
您为哪个用户添加了凭据?请记住,Chef 通常以 root 身份运行,因此任何凭据都会进入
/root/。 -
您好,aws 凭证和 .gitconfig 存储在 /root/.aws/ 下
-
凭证必须在你的 git 配置中,
/root/.aws/不会做任何事情。 -
我在 .gitconfig 中有这个,[credential] helper = !aws codecommit credential-helper $@ UseHttpPath = true
-
当我在本地运行克隆命令时它可以工作。
标签: amazon-web-services chef-infra test-kitchen