"究竟是做什么的?-6ren"> "究竟是做什么的?-根据“berks help update”,该命令应该: "Update the cookbooks (and dependencies) specified in the Berksfile" (是-6ren">
gpt4 book ai didi

chef-infra - "berks update "究竟是做什么的?

转载 作者:行者123 更新时间:2023-12-03 22:26:39 24 4
gpt4 key购买 nike

根据“berks help update”,该命令应该:

"Update the cookbooks (and dependencies) specified in the Berksfile"



(是的......这就是它所说的!)。

但这究竟是什么意思?

这与 Berksfile 中不同类型的“食谱”规范有何不同?

最佳答案

update 命令将尝试查找每本说明书的最新版本(仍满足您定义的任何版本要求)。例如,假设您有以下 Berksfile:

cookbook 'foo', '~> 1.0.0'

这告诉 Berkshelf 接受 1.0.x 中的任何版本系列。所以你运行 berks install和(假设) foo-1.0.5已安装到您本地的 Berkshelf 中。锁定文件将在 1.0.5 版中“锁定”foo 的定义,因此其他开发人员和 future 安装将始终使用 1.0.5 版(这是锁定文件的全部内容)。

(几个月过去了……)

现在您想将说明书更新到最新版本。但是因为 SemVer ,你想留在1.0.x系列。运行 berks update将解锁锁定文件中的硬依赖关系,但将约束保留在 Berksfile 中。所以(假设),如果社区网站有以下 foo 食谱版本:
  • 1.0.5
  • 1.0.6
  • 1.0.8
  • 1.1.0
  • 2.0.0
  • berks update会将您的本地版本更新为 1.0.8 ,因为这是仍然满足您的约束的最新发布版本。

    关于chef-infra - "berks update <cookbook-name>"究竟是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21034625/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com