opsworks_wrapper 0.2.0 → 0.2.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: 40e9f15632090461fc0c1243cd6dd94370882945
4
- data.tar.gz: 247915c8d6b5105abdabf2b960aa7650a0414268
3
+ metadata.gz: 1aad06d5c7e65fdb1790b881e4a7476c1b88e831
4
+ data.tar.gz: 6db540a5417cfbec50b1212fb8ccee7aa3101653
5
5
  SHA512:
6
- metadata.gz: 5666992cdb2760f699dc2bdc671408734ca9fadfda59c79be5ac09ea6eb0c75c165ede33994a21b45dec1c6b0a9bd08ef312adbbf1cb1cea3e7a0c680c72d96d
7
- data.tar.gz: 3bf986520f92cd8a7edd3ec2ecafea23278f6f1a0e574be6c4f1a40c6fed464e16634a9de7a05eecbe2142629018f1d3c618477639d5943d875e29fc777f3a87
6
+ metadata.gz: 38a7d9bbd22bac9a48d8c663c7a95c44be3f022ea4f353f4cc9c8bc5df27034d4e87a1eaef96ae195bc9b6d979faa9f0dacd0a71aac20df9d06458eb04c50dc1
7
+ data.tar.gz: 6ece2e203e239c82032ebda0dfc4341b45fbeb79ce077f51c869d1e24faaf1386622871596e2a64530af890793022a95872aacee1410bc8e8c2502a14b7485e6
data/README.md CHANGED
@@ -3,11 +3,17 @@
3
3
  A simple wrapper for aws-sdk to make handling opsworks operations easier.
4
4
 
5
5
  ## Supported Operations
6
+
7
+ ### Deployment
8
+ - Rolling/Non-Rolling deployment by layer
6
9
  - Update custom cookbooks
7
- - Deployment Creation for a particualr layer (by layer name)
8
- - Deployment Creation for all layers except a specified layer (exclusion by layer name)
10
+ - Non-Rolling Deployment Creation for all layers except a specified layer (exclusion by layer name)
9
11
  - Retrieve all instances for a given layer name
10
12
 
13
+ ### ELB
14
+ - Detach instance from ELB (wait for draining)
15
+ - Attach instance to ELB (wait for health check)
16
+
11
17
  ## Installation
12
18
 
13
19
  Add this line to your application's Gemfile:
@@ -26,9 +32,72 @@ Or install it yourself as:
26
32
 
27
33
  ## Usage
28
34
 
29
- TODO: Write usage instructions here
35
+ Example OpsWorks Configuration
36
+
37
+ A simple OpsWorks stack with 2 layers, one is attached to an ELB
38
+
39
+ Layer 1:
40
+ - name: Frontend
41
+ - ELB attached: yes
42
+
43
+ Layer 2:
44
+ - name: Backend
45
+ - ELB attached: no
46
+
47
+ ### Rolling Deployment
48
+
49
+ ```ruby
50
+ require 'aws-sdk'
51
+ require 'opsworks_wrapper'
52
+
53
+ ACCESS_KEY = "yourAccessKey"
54
+ SECRET_KEY = "yourSecretKey"
55
+ OPSWORKS_APP_ID = "yourAppID"
56
+
57
+ # update AWS credentials
58
+ Aws.config.update({
59
+ region: 'us-east-1',
60
+ credentials: Aws::Credentials.new(ACCESS_KEY, SECRET_KEY)
61
+ })
62
+
63
+ opsworks = OpsworksWrapper::Deployer.new(OPSWORKS_APP_ID)
64
+
65
+ # Do rolling deploy to backend layer
66
+ opsworks.deploy_layer_rolling('Backend')
67
+
68
+
69
+ # Do rolling deploy to frontend layer
70
+ # Note: Since frontend has an ELB, instances will be detached before deployment
71
+ # and re-attached. After re-attaching, wait for ELB health-check to pass
72
+ opsworks.deploy_layer_rolling('Frontend')
73
+ ```
74
+
75
+ ### Update Custom Cookbooks
76
+
77
+ ```ruby
78
+ require 'aws-sdk'
79
+ require 'opsworks_wrapper'
80
+
81
+ ACCESS_KEY = "yourAccessKey"
82
+ SECRET_KEY = "yourSecretKey"
83
+ OPSWORKS_APP_ID = "yourAppID"
84
+
85
+ # update AWS credentials
86
+ Aws.config.update({
87
+ region: 'us-east-1',
88
+ credentials: Aws::Credentials.new(ACCESS_KEY, SECRET_KEY)
89
+ })
90
+
91
+ opsworks = OpsworksWrapper::Deployer.new(OPSWORKS_APP_ID)
92
+
93
+ # Run command update-custom-cookbooks on all layers
94
+ # Note: this will not run deploy command
95
+ opsworks.update_cookbooks
96
+ ```
97
+
98
+ ## Contributions
30
99
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/ukayani/opsworks_wrapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ukayani/opsworks-wrapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
32
101
 
33
102
 
34
103
  ## License
@@ -1,5 +1,3 @@
1
- require "opsworks_wrapper/version"
2
-
3
1
  module OpsworksWrapper
4
2
  class Deployer
5
3
  require 'aws-sdk'
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "opsworks_wrapper"
7
- spec.version = '0.2.0'
7
+ spec.version = '0.2.1'
8
8
  spec.authors = ["Umair Kayani", "Calvin Fernandes"]
9
9
  spec.email = ["ukayani@loyalty.com", "cfernandes@loyalty.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Umair Kayani
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-21 00:00:00.000000000 Z
12
+ date: 2016-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk