gpt4 book ai didi

chef-infra - 如何在已经完成时阻止 Chef Recipe 运行

转载 作者:行者123 更新时间:2023-12-01 01:20:03 25 4
gpt4 key购买 nike

我为安装 phpunit 的 vagrant 制作了一个配方,但是当我使用 vagrant 停止然后 vagrant up 时它一直失败。

execute "discover phpunit" do
command "pear channel-discover pear.phpunit.de"
action :run
end

execute "config phpunit" do
command "pear config-set auto_discover 1"
action :run
end

execute "install phpunit" do
command "pear install pear.phpunit.de/PHPUnit"
action :run
end

我得到:
[default] [Thu, 29 Mar 2012 14:39:57 -0700] ERROR: execute[discover phpunit] (phpunit::default line 39) has had an error
[Thu, 29 Mar 2012 14:39:57 -0700] ERROR: execute[discover phpunit] (/tmp/vagrant-chef-1/chef-solo-1/phpunit/recipes/default.rb:39:in `from_file') had an error:
execute[discover phpunit] (phpunit::default line 39) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of pear channel-discover pear.phpunit.de ----
STDOUT: Channel "pear.phpunit.de" is already initialized

最佳答案

看起来正在发生的事情是每次都运行这个脚本vagrant up被执行。

你可能想要这样的东西:

execute "discover phpunit" do
command "pear channel-discover pear.phpunit.de"
action :run
not_if "which phpunit"
end

只要确保 phpunit就在你身边 $PATH

关于chef-infra - 如何在已经完成时阻止 Chef Recipe 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9934010/

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