26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/osiris/deployment.rb', line 26
def deploy(bucket, relative_path, version, application_name, deployment_group, description = nil)
begin
codedeploy = Aws::CodeDeploy::Client.new()
codedeploy.create_deployment({
application_name: application_name,
deployment_group_name: deployment_group,
revision: {
revision_type: 'S3',
s3_location: {
bucket: bucket,
key: File.join(relative_path, "#{version.to_s}.zip"),
bundle_type: 'zip'
}
},
deployment_config_name: 'CodeDeployDefault.OneAtATime',
description: description || "Deployed with Osiris, for more information see: https://github.com/wparad/Osiris",
ignore_application_stop_failures: false
})
rescue Aws::CodeDeploy::Errors::ServiceError => exception
puts "Failed to deploy resource: #{exception}"
rescue Exception => exception
puts "Failed to connect to AWS: #{exception}"
end
end
|