【发布时间】:2019-08-25 13:24:42
【问题描述】:
我有一个代码来比较文件和工件中的 sha-256 值,如果校验和不匹配,则会引发错误。但我想在我自己的配方中计算校验和,而不是从工件中读取它。下面是我到目前为止的代码,并试图找出我的配方中是否有任何函数或方法可以用来计算文件的 sha-256。 提前致谢
only_if { node['abc'] }
not_if { ::File.exist?(checksum_file) and ::File.read(checksum_file).strip==coordinates['checksum'].strip }
message 'The previously deployed checksum is not aligned with the actual value'
level :debug
notifies :create, 'remote_file[download file]', :immediately
end```
【问题讨论】:
标签: ruby chef-infra chef-recipe