我正在尝试使用Chef execute resource
解压缩文件execute "unzipping_webapp" do
cwd "#{node[:config][:repo_dir]}"
command <<-EOF
unzip -o #{node[:config][:webapp_name]}
EOF
end
也试过
execute "unzipping webapp" do
command "unzip -o #{node[:config][:webapp_name]}"
cwd "#{node[:config][:repo_dir]}"
end
我收到类似
的错误================================================================================
Error executing action `run` on resource 'execute[unzipping_webapp]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of unzip -o webapp.zip
----
STDOUT: Archive: webapp.zip
warning: skipped "../" path component(s) in ../webapp/
creating: webapp/
warning: skipped "../" path component(s) in ../webapp/bower.json
inflating: webapp/bower.json
warning: skipped "../" path component(s) in ../webapp/bower_components/
creating: webapp/bower_components/
warning: skipped "../" path component(s) in ../webapp/bower_components/bootstrap/.bower.json
inflating: webapp/bower_components/bootstrap/.bower.json
warning: skipped "../" path component(s) in ../webapp/bower_components/bootstrap/bower.json
inflating: webapp/bower_components/bootstrap/bower.json
.
.More files
.
warning: skipped "../" path component(s) in ../webapp/js/
creating: webapp/js/
warning: skipped "../" path component(s) in ../webapp/js/app.js
extracting: webapp/js/app.js
STDERR:
---- End output of unzip -o webapp.zip
----
Ran unzip -o webapp.zip
returned 1
当我检查系统时,文件已成功解压缩。
我不明白为什么我的厨师在正确执行事情时失败了。
之前是否有人遇到此问题或有解决方案?