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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/osiris/deployment.rb +28 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjY3NTU4NDQ0MTNiNDM3OWY2ZGFkZmExODYxNzI5N2IxNmYwZGRkNQ==
4
+ ZjY5Njc0MzEyMWNjZjRiMGM0ZGM0YTUzNzA0Nzk0ZTM4YmViOGMyYQ==
5
5
  data.tar.gz: !binary |-
6
- Y2Y4M2JiODEwMTU0ODZiZTI2OWQwNjEyZWQ3MmIwMDVlOTY5MDM0Yg==
6
+ ZTc2NWExZTVjODQ5YjNhYWI0ZDA1ODIyYWY4NTJjOWQ5YmUyYjcxMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2ZkNDFjOTRhNjVjNDE5MjJiNTU3ODdhOTI4Nzg1NmI5ZTAwZDFiYTZkNTM4
10
- OGQ4ZGVhNjgxMDU3N2ZlY2MzY2RjYTRkMjc5NWFhMTU4NDNiMjA2NmMwYzQ5
11
- NWUzM2JlMTU0M2QyZTkwNDMxZmZhYWU5Nzc3ZjRlZDU4ZWIyZjk=
9
+ NDdhMmU5OWMwZjg5NTY4YmNhNjc0MjVkYjQ2ZmI0ODA5Y2JmNmIyYzhmZDZi
10
+ ZTA5YmFhM2M4ZDFmZGYwYTRjODliMzZiOWZhOWUyNmZkNmUwYzE3YmE3ODBl
11
+ ZTdhM2I3NjU5ZWYyMWJlYzEyZmVmMWRmODZlYWJkMDU0YWM3NWI=
12
12
  data.tar.gz: !binary |-
13
- MGE5NDg2OTkwZmEzYWM4OWU0NGFjOTIyMzZlMmQxYzNlODcwYWMxNjM5Y2Rh
14
- MTc5N2JmZGVkMzhjYWQxYjA3ZGU3ZTVlMTk5MWNmYTU1Njg4OTRlYjgxZDAx
15
- NTAwY2ZmOThlNjQzYmFkNDhmM2UyN2UxZmE0ZWVlMmVkNTMyOTU=
13
+ MGU2MzYyMTkxYzc5NjgxNWJjNjdlNDliZjRjOTE0Mzc1NDMzNTliOGNiY2U3
14
+ YzY0MWI4MjcwMDU5YjE4ZWE3MmY1OTdhYmNiM2IxMzM4ZTQwMzg3YmJlZDE0
15
+ ODZlYWRmYTQxZGE1NGZlODdjNWNlNzhmZTUzMzMwMjM3NGJhNjM=
@@ -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
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.9.0
4
+ version: 1.0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Warren Parad