osiris 1.0.9.0 → 1.0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/osiris/deployment.rb +28 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjY5Njc0MzEyMWNjZjRiMGM0ZGM0YTUzNzA0Nzk0ZTM4YmViOGMyYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTc2NWExZTVjODQ5YjNhYWI0ZDA1ODIyYWY4NTJjOWQ5YmUyYjcxMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDdhMmU5OWMwZjg5NTY4YmNhNjc0MjVkYjQ2ZmI0ODA5Y2JmNmIyYzhmZDZi
|
10
|
+
ZTA5YmFhM2M4ZDFmZGYwYTRjODliMzZiOWZhOWUyNmZkNmUwYzE3YmE3ODBl
|
11
|
+
ZTdhM2I3NjU5ZWYyMWJlYzEyZmVmMWRmODZlYWJkMDU0YWM3NWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGU2MzYyMTkxYzc5NjgxNWJjNjdlNDliZjRjOTE0Mzc1NDMzNTliOGNiY2U3
|
14
|
+
YzY0MWI4MjcwMDU5YjE4ZWE3MmY1OTdhYmNiM2IxMzM4ZTQwMzg3YmJlZDE0
|
15
|
+
ODZlYWRmYTQxZGE1NGZlODdjNWNlNzhmZTUzMzMwMjM3NGJhNjM=
|
data/lib/osiris/deployment.rb
CHANGED
@@ -2,7 +2,8 @@ require 'aws-sdk'
|
|
2
2
|
|
3
3
|
module Osiris
|
4
4
|
class Deployment
|
5
|
-
def initialize()
|
5
|
+
def initialize(use_bundled_cert)
|
6
|
+
Aws.use_bundled_cert! if use_bundled_cert
|
6
7
|
end
|
7
8
|
|
8
9
|
def publish(bucket, relative_path, local_directory, version)
|
@@ -21,5 +22,31 @@ module Osiris
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
25
|
+
|
26
|
+
def deploy(bucket, relative_path, version, application_name, deployment_group)
|
27
|
+
begin
|
28
|
+
codedeploy = Aws::CodeDeploy::Client.new()
|
29
|
+
codedeploy.create_deployment({
|
30
|
+
application_name: application_name, # required
|
31
|
+
deployment_group_name: deployment_group,
|
32
|
+
revision: {
|
33
|
+
revision_type: 'S3'
|
34
|
+
s3_location: {
|
35
|
+
bucket: bucket,
|
36
|
+
key: File.join(relative_path, "#{version.to_s}.zip"),
|
37
|
+
bundle_type: 'zip'
|
38
|
+
}
|
39
|
+
},
|
40
|
+
deployment_config_name: 'CodeDeployDefault.OneAtATime',
|
41
|
+
description: "#{application_name}:#{deployment_group} - #{bucket}_#{File.join(relative_path, "#{version.to_s}.zip")}",
|
42
|
+
ignore_application_stop_failures: false
|
43
|
+
})
|
44
|
+
rescue Aws::CodeDeploy::Errors::ServiceError
|
45
|
+
puts "Failed to deploy resource: #{exception}"
|
46
|
+
rescue Exception => exception
|
47
|
+
puts "Failed to connect to AWS: #{exception}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
24
51
|
end
|
25
52
|
end
|