simple_deploy 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +57 -0
- data/lib/simple_deploy/aws/simpledb.rb +26 -6
- data/lib/simple_deploy/version.rb +1 -1
- data/simple_deploy.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35d6afc5913093b822e4f58784676020838d1489
|
4
|
+
data.tar.gz: 3592e8cd7b9492323cdf32372474c3c5d01dde27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4e27f8d4f7bdef7f4ea13b40ee9332d114c3e7be4635660f71995647e610c22aac75d90b776d906bcdffd476b91da455521a48a0c667c8028f6f8826d2d45b9
|
7
|
+
data.tar.gz: f7402f08cf70a472daab185755d6c3289db11b89c0e941146c9528726116153911b7d151d9552ecca400bf4f4a9e16fd51545f75be458f644e8e7558c11ccdfd
|
data/README.md
CHANGED
@@ -1,5 +1,62 @@
|
|
1
1
|
[](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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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
|
-
|
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
|
-
|
69
|
+
with_retries(retry_options) do
|
70
|
+
@connect.delete_attributes domain, key, attributes
|
71
|
+
end
|
52
72
|
end
|
53
73
|
|
54
74
|
end
|
data/simple_deploy.gemspec
CHANGED
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.
|
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:
|
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.
|
289
|
+
rubygems_version: 2.2.2
|
276
290
|
signing_key:
|
277
291
|
specification_version: 4
|
278
292
|
summary: Opinionated gem for AWS resource management.
|