0

我确信有一个简单的答案。我们的程序是一个可执行的 jar 文件,我们有一个 shell 脚本包装器。

  • OpsWorks 从 S3 抓取分发 zip 文件
  • 我们正在尝试解压缩并运行位于bin/run_server.sh

我目前正在为其编写自定义部署配方,在“其他”类型的层上运行。

这是我的尝试:

include_recipe 'deploy'

node[:deploy].each do |application, deploy|

    # assume the zip file has been extracted at this point, 
    # and the CWD is the extracted contents
    execute "run the server" do
        command 'bash bin/run_server.sh'
        action :run
    end
end

这失败了,声称它找不到bin/run_server.sh

提前致谢。

4

1 回答 1

0

您是否尝试过明确设置 cwd ?

execute "run the server" do
    command 'bash bin/run_server.sh'
    cwd "/path/to/your/stuff"
end
于 2014-04-22T08:20:50.963 回答