如何解冻食谱

时间:2018-01-02 19:29:46

标签: chef berkshelf

我发现有能力通过berks上传来意外冻结厨师的食谱。能够阻止更改并上传到食谱听起来真的很棒。但...

如何解冻食谱?我无法找到任何文件或任何帖子询问此事。对于为什么,你为什么要这样做听起来可能听起来反直觉?你发布了你的食谱,你不应该改变历史。

如果你有生产紧急情况,那个版本的食谱就会破坏一切。第一个答案可能是,继续前进并解决问题---但这可能需要一段时间。第二个答案可能是,修改固定到上一个版本的版本---但是,如果你有50个固定到该版本的烹饪书怎么办?也不实用。

看起来非常有用,可以解冻一些东西。是的,您可以使用-f选项强制更新。但不得不强制更新未来广告中的每一个变化都听起来很笨拙而且不合适。特别是当有人不小心冻结了食谱时(例如在我的情况下)。

3 个答案:

答案 0 :(得分:0)

您可以强制上传新版本,并将冻结标志设置为false。我们没有具体揭露这一点或使其变得容易,因为它有点失败。更好的解决方案是使用SemVer固定而不是单个版本或使用更新的Policyfile系统。

答案 1 :(得分:0)

当您意外冻结食谱版本时,您可以使用berks upload --force。我不明白你没有使用强制选项。

$ berks help upload
Usage:
  berks upload [COOKBOOKS]

Options:
  -b, [--berksfile=PATH]                               # Path to a Berksfile to operate off of.
  -e, [--except=one two three]                         # Exclude cookbooks that are in these groups.
  -o, [--only=one two three]                           # Only cookbooks that are in these groups.
      [--no-freeze], [--no-no-freeze]                  # Do not freeze uploaded cookbook(s).
      [--force]                                        # Upload all cookbooks even if a frozen one exists on the Chef Server.
      [--ssl-verify], [--no-ssl-verify]                # Disable/Enable SSL verification when uploading cookbooks.
  -s, [--skip-syntax-check], [--no-skip-syntax-check]  # Skip Ruby syntax check when uploading cookbooks.
      [--halt-on-frozen], [--no-halt-on-frozen]        # Exit with a non zero exit code if the Chef Server already has the version of the cookbook(s).
  -c, [--config=PATH]                                  # Path to Berkshelf configuration to use.
  -F, [--format=FORMAT]                                # Output format to use.
                                                       # Default: human
  -q, [--quiet], [--no-quiet]                          # Silence all informational output.
  -d, [--debug], [--no-debug]                          # Output debug information

答案 2 :(得分:0)

只需删除该食谱的版本并重新加载即可。请尝试以下:

knife cookbook delete <cookbook name>
knife cookbook upload <cookbook name>