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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWRiODA4NTA3M2QxOTk3ZDY5ZjViN2ZlOWNiZTQ1NTdmYTk2ZjYzNQ==
4
+ NjY3NTU4NDQ0MTNiNDM3OWY2ZGFkZmExODYxNzI5N2IxNmYwZGRkNQ==
5
5
  data.tar.gz: !binary |-
6
- NGI1ZDdhYTFjZTNiOWJlMmVjYjliNzg3NTIwMGQ0NDcwZjEzODAxZg==
6
+ Y2Y4M2JiODEwMTU0ODZiZTI2OWQwNjEyZWQ3MmIwMDVlOTY5MDM0Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDkxYWRjNjI0NjgyZjJiYTQ3ZThhYzNiOTA1ZGYzYmU1NmY1ZjZkMjkxZjNk
10
- MWRiMzU5YmJjNDQyNTYzMGQ2YjA3NjViOTllNDFhNWQ5OWMxOTcyNWU3Y2Yz
11
- YmQ1ZWVmYzk2ZmI3Nzg4ZDU2Y2M5NmViNmIxZWFiYjEzZmZjYjQ=
9
+ Y2ZkNDFjOTRhNjVjNDE5MjJiNTU3ODdhOTI4Nzg1NmI5ZTAwZDFiYTZkNTM4
10
+ OGQ4ZGVhNjgxMDU3N2ZlY2MzY2RjYTRkMjc5NWFhMTU4NDNiMjA2NmMwYzQ5
11
+ NWUzM2JlMTU0M2QyZTkwNDMxZmZhYWU5Nzc3ZjRlZDU4ZWIyZjk=
12
12
  data.tar.gz: !binary |-
13
- MTU1YmQwNDA2ODQ2OGRiOTU4NDNjN2FmZGQxYzA4MDM5NWQ3YjFhMjc0MmU3
14
- NWU3ODFkNzI2MWMwMDk5NGQ1ZGY2MzM2ZjNmNGMxOTY5ZjQ0OWQyZWYxM2Fl
15
- ODBkOWNiYTdhMDc0ZGJhYjBiODNlZmExZDVjM2U1NDVjZjRkZmU=
13
+ MGE5NDg2OTkwZmEzYWM4OWU0NGFjOTIyMzZlMmQxYzNlODcwYWMxNjM5Y2Rh
14
+ MTc5N2JmZGVkMzhjYWQxYjA3ZGU3ZTVlMTk5MWNmYTU1Njg4OTRlYjgxZDAx
15
+ NTAwY2ZmOThlNjQzYmFkNDhmM2UyN2UxZmE0ZWVlMmVkNTMyOTU=
@@ -5,4 +5,4 @@ STDOUT.sync = true
5
5
  STDERR.sync = true
6
6
 
7
7
  # :nodoc:
8
- include Stash::DSL
8
+ include Osiris::DSL
@@ -1,12 +1,25 @@
1
+ require 'aws-sdk'
2
+
1
3
  module Osiris
2
4
  class Deployment
3
- #attr_accessor :server
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osiris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8.0
4
+ version: 1.0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Warren Parad