osiris 1.0.8.0 → 1.0.9.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.rb +1 -1
- data/lib/osiris/deployment.rb +18 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjY3NTU4NDQ0MTNiNDM3OWY2ZGFkZmExODYxNzI5N2IxNmYwZGRkNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2Y4M2JiODEwMTU0ODZiZTI2OWQwNjEyZWQ3MmIwMDVlOTY5MDM0Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2ZkNDFjOTRhNjVjNDE5MjJiNTU3ODdhOTI4Nzg1NmI5ZTAwZDFiYTZkNTM4
|
10
|
+
OGQ4ZGVhNjgxMDU3N2ZlY2MzY2RjYTRkMjc5NWFhMTU4NDNiMjA2NmMwYzQ5
|
11
|
+
NWUzM2JlMTU0M2QyZTkwNDMxZmZhYWU5Nzc3ZjRlZDU4ZWIyZjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGE5NDg2OTkwZmEzYWM4OWU0NGFjOTIyMzZlMmQxYzNlODcwYWMxNjM5Y2Rh
|
14
|
+
MTc5N2JmZGVkMzhjYWQxYjA3ZGU3ZTVlMTk5MWNmYTU1Njg4OTRlYjgxZDAx
|
15
|
+
NTAwY2ZmOThlNjQzYmFkNDhmM2UyN2UxZmE0ZWVlMmVkNTMyOTU=
|
data/lib/osiris.rb
CHANGED
data/lib/osiris/deployment.rb
CHANGED
@@ -1,12 +1,25 @@
|
|
1
|
+
require 'aws-sdk'
|
2
|
+
|
1
3
|
module Osiris
|
2
4
|
class Deployment
|
3
|
-
|
4
|
-
|
5
|
-
def initialize(secret_id, secret_key, region)
|
5
|
+
def initialize()
|
6
6
|
end
|
7
7
|
|
8
|
-
def publish(bucket, relative_path, local_directory)
|
9
|
-
|
8
|
+
def publish(bucket, relative_path, local_directory, version)
|
9
|
+
Dir.mktmpdir do |tmp|
|
10
|
+
zip_file = File.join(tmp, "#{version.to_s}.zip")
|
11
|
+
ZipFileGenerator.new().write(local_directory, zip_file);
|
12
|
+
|
13
|
+
begin
|
14
|
+
s3 = Aws::S3::Resource.new()
|
15
|
+
obj = s3.bucket(bucket).object(File.join(relative_path, File.basename(zip_file)))
|
16
|
+
obj.upload_file(zip_file)
|
17
|
+
rescue Aws::S3::Errors::ServiceError => exception
|
18
|
+
puts "Failed to publish resource: #{exception}"
|
19
|
+
rescue Exception => exception
|
20
|
+
puts "Failed to connect to AWS: #{exception}"
|
21
|
+
end
|
22
|
+
end
|
10
23
|
end
|
11
24
|
end
|
12
25
|
end
|