simple_deploy 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f5fb034e0653513a96ea3fdb056cb45ba57dc57
4
- data.tar.gz: efb53e25db4f197ebe9da6f867bfc76f14a1c1f5
3
+ metadata.gz: 35d6afc5913093b822e4f58784676020838d1489
4
+ data.tar.gz: 3592e8cd7b9492323cdf32372474c3c5d01dde27
5
5
  SHA512:
6
- metadata.gz: 84eb45c9c03c3c3036376bdab8282d0d0160f704add25d78e6b1167a72e4036ba2660dcab76d4fe51e1263ac1e0adc8b788b421173a8a6c59b16c20c48ab4b9a
7
- data.tar.gz: cff6a07835a614e5c260ee987d293fe48eb6bad67d6e82748cfaa35d525cda5c8e4d5c6b9054aec0dd58a38fa11e43e7d20f6bb827a721a44d320ea6f3c9edf2
6
+ metadata.gz: f4e27f8d4f7bdef7f4ea13b40ee9332d114c3e7be4635660f71995647e610c22aac75d90b776d906bcdffd476b91da455521a48a0c667c8028f6f8826d2d45b9
7
+ data.tar.gz: f7402f08cf70a472daab185755d6c3289db11b89c0e941146c9528726116153911b7d151d9552ecca400bf4f4a9e16fd51545f75be458f644e8e7558c11ccdfd
data/README.md CHANGED
@@ -1,5 +1,62 @@
1
1
  [![Build Status](https://secure.travis-ci.org/intuit/simple_deploy.png)](http://travis-ci.org/intuit/simple_deploy)
2
2
 
3
+ **Simple Deploy is in maintenance mode!**
4
+
5
+ **We will continue to provide support for bug fix requests, however new
6
+ features will not be added.**
7
+
8
+ It has been a good run, but it has now come to an end. When Simple Deploy was started,
9
+ the [AWS CLI](http://aws.amazon.com/cli/) had minimal Cloud Formation support; that
10
+ is no longer the case. The AWS CLI is mature, well-documented and can be used
11
+ to perform the majority of the Cloud Formation actions provided by Simple Deploy
12
+ and we believe new customers will be better served leveraging it for their Cloud
13
+ Formation stack management.
14
+
15
+ For the features which Simple Deploy provides that are not available via AWS CLI,
16
+ we have created the following utilities to provide near-like services, to what is
17
+ provided by Simple Deploy, which can be integrated with the AWS CLI.
18
+
19
+ * [cfn-clone](https://github.com/intuit/cfn-clone) allows for cloning Cloud Formation
20
+ stacks. It will leverage the AWS CLI to read the parameters and template from an existing
21
+ stack. It allows you to override either the template or inputs and create a new stack
22
+ with the updated attirbutes and template.
23
+
24
+ * [heirloom-url](https://github.com/intuit/heirloom-url) generates URLs that point to resources
25
+ which have been uploaded to Heirloom. This can be coupled with the AWS CLI to update
26
+ the app or chef_repo.
27
+
28
+ For example, to update the app and chef_repo of a stack, and then kick off a command,
29
+ similiar to the Simple Deploy deploy subcommand, you could use the following bash script.
30
+
31
+ ```
32
+ #!/bin/bash
33
+
34
+ app_id=$1
35
+ chef_id=$2
36
+
37
+ app_url=`heirloom-url -bucket-prefix=bp -domain=my-app -encrypted=true -id=$app_id -region=us-west-2`
38
+ chef_url=`heirloom-url -bucket-prefix=bp -domain=my-chef -encrypted=true -id=$chef_id -region=us-west-2`
39
+
40
+ aws cloudformation update-stack --stack-name my-app-stack \
41
+ --parameters AppArtifactURL=$app_url,ChefRepoURL=$chef_url
42
+
43
+ ips=`aws ec2 describe-instances --filter Name=Name,Values=my-app-stack \
44
+ | jq --raw-output '.Reservations[].Instances[].PublicIpAddress'`
45
+
46
+ for ip in $ips; do
47
+ ssh ip 'chef-solo -c /var/chef/config/solo.rb -o role[app]’
48
+ done
49
+ ```
50
+
51
+ If you are interested in more efficient SSH parallelization, I would look into one
52
+ of the below tools which could be integrated into the above script.
53
+
54
+ * [Capistrano](http://capistranorb.com/)
55
+ * [GNU Parallel](http://www.gnu.org/software/parallel/)
56
+
57
+ Overview
58
+ --------
59
+
3
60
  Simple Deploy is an opinionated gem that helps manage and perform directed deployments to AWS Cloud Formation Stacks.
4
61
 
5
62
  Prerequisites
@@ -1,4 +1,5 @@
1
1
  require 'fog'
2
+ require 'retries'
2
3
 
3
4
  module SimpleDeploy
4
5
  class AWS
@@ -11,8 +12,17 @@ module SimpleDeploy
11
12
  @connect = Fog::AWS::SimpleDB.new connection_args
12
13
  end
13
14
 
15
+ def retry_options
16
+ {:max_retries => 3,
17
+ :rescue => Excon::Errors::ServiceUnavailable,
18
+ :base_sleep_seconds => 10,
19
+ :max_sleep_seconds => 60}
20
+ end
21
+
14
22
  def domains
15
- @connect.list_domains.body['Domains']
23
+ with_retries(retry_options) do
24
+ @connect.list_domains.body['Domains']
25
+ end
16
26
  end
17
27
 
18
28
  def domain_exists?(domain)
@@ -20,11 +30,15 @@ module SimpleDeploy
20
30
  end
21
31
 
22
32
  def create_domain(domain)
23
- @connect.create_domain(domain) unless domain_exists?(domain)
33
+ with_retries(retry_options) do
34
+ @connect.create_domain(domain) unless domain_exists?(domain)
35
+ end
24
36
  end
25
37
 
26
38
  def put_attributes(domain, key, attributes, options)
27
- @connect.put_attributes domain, key, attributes, options
39
+ with_retries(retry_options) do
40
+ @connect.put_attributes domain, key, attributes, options
41
+ end
28
42
  end
29
43
 
30
44
  def select(query)
@@ -34,7 +48,9 @@ module SimpleDeploy
34
48
 
35
49
  while true
36
50
  options.merge! 'NextToken' => next_token
37
- chunk = @connect.select(query, options).body
51
+ chunk = with_retries(retry_options) do
52
+ @connect.select(query, options).body
53
+ end
38
54
  data.merge! chunk['Items']
39
55
  next_token = chunk['NextToken']
40
56
  break unless next_token
@@ -44,11 +60,15 @@ module SimpleDeploy
44
60
  end
45
61
 
46
62
  def delete(domain, key)
47
- @connect.delete_attributes domain, key
63
+ with_retries(retry_options) do
64
+ @connect.delete_attributes domain, key
65
+ end
48
66
  end
49
67
 
50
68
  def delete_items(domain, key, attributes)
51
- @connect.delete_attributes domain, key, attributes
69
+ with_retries(retry_options) do
70
+ @connect.delete_attributes domain, key, attributes
71
+ end
52
72
  end
53
73
 
54
74
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleDeploy
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
@@ -28,4 +28,5 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency "esbit", "~> 0.0.4"
29
29
  s.add_runtime_dependency "trollop", "= 2.0"
30
30
  s.add_runtime_dependency "fog", "= 1.23.0"
31
+ s.add_runtime_dependency "retries", "= 0.0.5"
31
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Weaver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.23.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: retries
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.0.5
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.0.5
139
153
  description: Opinionated gem for Managing AWS Cloud Formation stacks and deploying
140
154
  updates to Instances.
141
155
  email:
@@ -272,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
286
  version: '0'
273
287
  requirements: []
274
288
  rubyforge_project: simple_deploy
275
- rubygems_version: 2.0.3
289
+ rubygems_version: 2.2.2
276
290
  signing_key:
277
291
  specification_version: 4
278
292
  summary: Opinionated gem for AWS resource management.