#840: new deploy_info parameter 'json_file'
This commit is contained in:
parent
84822598a2
commit
74a9530888
@ -353,14 +353,20 @@ module Devops
|
|||||||
cmd = "chef-client --no-color"
|
cmd = "chef-client --no-color"
|
||||||
if deploy_info["use_json_file"]
|
if deploy_info["use_json_file"]
|
||||||
deploy_info.delete("use_json_file")
|
deploy_info.delete("use_json_file")
|
||||||
@out << "Deploy Input Parameters:\n"
|
json = nil
|
||||||
json = JSON.pretty_generate(deploy_info)
|
|
||||||
@out.puts json
|
|
||||||
file = "#{@server.project}_#{@server.deploy_env}_#{Time.new.to_i}"
|
|
||||||
dir = DevopsConfig.config[:project_info_dir]
|
dir = DevopsConfig.config[:project_info_dir]
|
||||||
File.open(File.join(dir, file), "w") do |f|
|
file = deploy_info["json_file"] || "#{@server.project}_#{@server.deploy_env}_#{Time.new.to_i}"
|
||||||
f.write json
|
path = File.join(dir, file)
|
||||||
|
if File.exists?(path)
|
||||||
|
json = File.read(path)
|
||||||
|
else
|
||||||
|
json = JSON.pretty_generate(deploy_info)
|
||||||
|
File.open(File.join(dir, file), "w") do |f|
|
||||||
|
f.write json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@out << "Deploy Input Parameters:\n"
|
||||||
|
@out.puts json
|
||||||
@out.flush
|
@out.flush
|
||||||
cmd << " -j http://#{DevopsConfig.config[:address]}:#{DevopsConfig.config[:port]}/#{DevopsConfig.config[:url_prefix]}/v2.0/deploy/data/#{file}"
|
cmd << " -j http://#{DevopsConfig.config[:address]}:#{DevopsConfig.config[:port]}/#{DevopsConfig.config[:url_prefix]}/v2.0/deploy/data/#{file}"
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user