Install `nginx-build` when finding a newer version.

This commit is contained in:
Kazuhiro MUSASHI 2019-11-08 00:27:53 +08:00
parent dc6b5a2f01
commit 40e7c26656
1 changed files with 10 additions and 5 deletions

View File

@ -50,6 +50,10 @@ rescue
raise 'Cannot connect to http://github.com.' raise 'Cannot connect to http://github.com.'
end end
# バージョン確認して、アップデート必要かどうか確認
result = run_command("/home/webadm/nginx-build/nginx-build --version | grep #{tag_version}", error: false)
if result.exit_status != 0
# Download `nginx-build`: # Download `nginx-build`:
execute "wget #{nginxbuild} -O #{TARBALL}" execute "wget #{nginxbuild} -O #{TARBALL}"
@ -57,6 +61,7 @@ execute "tar xf #{TARBALL} && chown webadm:webadm #{NGINXBUILD}" do
user USER user USER
cwd WORKDIR cwd WORKDIR
end end
end
# Deploy `configure.sh`: # Deploy `configure.sh`:
remote_file "#{WORKDIR}/configure.sh" do remote_file "#{WORKDIR}/configure.sh" do