我已经检查了几次这个代码,我不知道为什么extract\u presta块没有被触发。我已经确认我要查找的文件不在/var/www/html目录中:c)
我想要达到的是:
-
下载一个文件,解压它,但只有当一个特定的文件不存在
-
下载后停止apache,解压文件
-
启动apache
请给我一些建议好吗?谢谢。
service "apache" do
action :nothing
end
execute 'extract_presta' do
command 'unzip /tmp/prestashop_1.7.4.2.zip'
cwd '/var/www/html'
not_if { File.exists?("/var/www/html/autoload.php") }
action :nothing
notifies :start, "service[apache]"
end
remote_file "/tmp/prestashop_1.7.4.2.zip" do
source "https://download.prestashop.com/download/releases/prestashop_1.7.4.2.zip"
notifies :stop, "service[apache]", :immediately
notifies :run, 'execute[extract_presta]', :immediately
end