opsworks_wrapper 0.2.0 → 0.2.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 +73 -4
- data/lib/opsworks_wrapper.rb +0 -2
- data/opsworks_wrapper.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aad06d5c7e65fdb1790b881e4a7476c1b88e831
|
4
|
+
data.tar.gz: 6db540a5417cfbec50b1212fb8ccee7aa3101653
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
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/
|
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
|
data/lib/opsworks_wrapper.rb
CHANGED
data/opsworks_wrapper.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
12
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|