Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
厨师配方中的Git签出不起作用_Git_Chef Infra_Recipe - Fatal编程技术网

厨师配方中的Git签出不起作用

厨师配方中的Git签出不起作用,git,chef-infra,recipe,Git,Chef Infra,Recipe,我使用以下chef小节尝试签出github存储库: git "/home/ubuntu" do repository "git://github.com/kmerenkov/brukva.git" revision "master" action :checkout user "ubuntu" end chef运行没有错误,资源显示为最新(即使目标目录中没有文件) 我做错了什么?试试: git "/home/ubuntu/brukva" do

我使用以下chef小节尝试签出github存储库:

   git "/home/ubuntu" do
     repository "git://github.com/kmerenkov/brukva.git"
     revision "master"
     action :checkout
     user "ubuntu"
   end
chef运行没有错误,资源显示为最新(即使目标目录中没有文件)

我做错了什么?

试试:

git "/home/ubuntu/brukva" do
  repository "git://github.com/kmerenkov/brukva.git"
  revision "master"
  action :sync
  user "ubuntu"
end
当使用
:checkout
时,如果目标目录存在,它将不起任何作用,因为它假定您的签出已经完成,您可以看到chef告诉“最新”


参考git提供商的指南

BTW,Im使用git 1.8.3和chef 11.8.0。我在没有luckIt的多个github存储库中尝试过这一点,看起来这里是一个使用克隆而不是签出的地方。您使用的结账台是针对厨师的吗?它实际上是指克隆吗?不幸的是,目前git资源同步、签出和导出只有三个“操作”。签出用于克隆源回购-谢谢,这帮了大忙@jhngmsith如果这解决了您的问题,请将其标记为“正确”,您可以省略
操作:sync
,因为这是默认操作。
git "/home/ubuntu/brukva" do
  repository "git://github.com/kmerenkov/brukva.git"
  revision "master"
  action :sync
  user "ubuntu"
end