Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,18 @@ def parse_hooks(hooks_hash)
temp_hooks_hash = Hash.new
hooks_hash.each_pair do |hook, scripts|
current_hook_scripts = []
scripts.each do |script|
if (script.has_key?('location') && !script['location'].nil?)
current_hook_scripts << InstanceAgent::Plugins::CodeDeployPlugin::ApplicationSpecification::ScriptInfo.new(script['location'].to_s.strip,
{
:runas => script.has_key?('runas') && !script['runas'].nil? ? script['runas'].to_s.strip : nil,
:sudo => script['sudo'],
:timeout => script['timeout']
})
else
raise AppSpecValidationException, 'The deployment failed because the application specification file specifies a script with no location value. Specify the location in the hooks section of the AppSpec file, and then try again.'
if scripts.kind_of?(Array)
scripts.each do |script|
if script['location'].kind_of?(String)
current_hook_scripts << InstanceAgent::Plugins::CodeDeployPlugin::ApplicationSpecification::ScriptInfo.new(script['location'].to_s.strip,
{
:runas => script.has_key?('runas') && !script['runas'].nil? ? script['runas'].to_s.strip : nil,
:sudo => script['sudo'],
:timeout => script['timeout']
})
else
raise AppSpecValidationException, 'The deployment failed because the application specification file specifies a script with no location value. Specify the location in the hooks section of the AppSpec file, and then try again.'
end
end
end
temp_hooks_hash[hook] = current_hook_scripts
Expand Down