【问题标题】:Chef git resource doesn't download but says "up to date"Chef git 资源未下载,但显示“最新”
【发布时间】:2021-07-14 22:50:48
【问题描述】:

这是我的厨师代码

git "/usr/local" do
  repository "https://github.internal.com/TOTC/maven-install.git"
  revision 'master'
  action :sync
  #notifies :run, "execute[unpack_maven]"
end

git "/opt/chef/cache" do
  repository "https://github.kdc.internal.com/TOTC/Python_Install.git" 
  revision 'master'
  action :sync
  #notifies :run, "execute[unpack_python]"
end

当其中任何一个运行时,它都会显示..,

git[/opt/chef/cache] action checkout (up to date)
execute[unpack_python] action runsh: line 0: cd: /opt/chef/cache/Python_Install/: No such file or directory

它似乎认为它是最新的并与主存储库同步,但是当我查找该文件夹时它不存在。

有人见过这种行为吗?

【问题讨论】:

    标签: git chef-infra


    【解决方案1】:

    所以有几个问题。首先也是最重要的一点是,您提供给 git 资源的路径与 git clone 命令不同。它不会创建/usr/local/maven-install。你告诉它用 git repo 覆盖所有/usr/local,这似乎不太可能是你的目标。其次是您可能在执行资源上没有action :nothing,添加它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      相关资源
      最近更新 更多