cloudspin-stack-rake 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +76 -6
- data/cloudspin-stack-rake.gemspec +3 -3
- data/lib/cloudspin/stack/rake/version.rb +1 -1
- metadata +12 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44795420dcb8c0f155c14901d97232e3713b4ab33eb832081c9f48c02b002890
|
4
|
+
data.tar.gz: 39fa269d73c166910feb86e8b03e317c7b6d1cf9f96ae7eb79aca9ae82834794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6936a4c98ddf423ccddfe3562ba85cafd10f201642df572aed16714aec0fd27d0b010fd0c422ef9493a74355f892ef36f5b45232d68f7f1aaf6c61b3ec7949df
|
7
|
+
data.tar.gz: 373e6fd9713f20d967cf7999ee41cdf682b89becfc68c04879d3b059d739abc85df7441b2adc0cbef99ad3fe4902417001f2c934444d7b68bd7a9e90fac1163b
|
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# Cloudspin::Stack::Rake
|
2
2
|
|
3
|
-
|
3
|
+
This Ruby library can be used in a Rakefile to manage infrastructure stacks. It makes use of the [cloudspin-stack](https://github.com/cloudspinners/cloudspin-stack) gem for the actual stack management code. The ideas behind this are documented (somewhat) in that project.
|
4
|
+
|
5
|
+
This is a prototype for an infrastructure project delivery framework. It is intended as a basis for exploring project structures, conventions, and functionality, but is not currently in a stable state.
|
6
|
+
|
7
|
+
Feel free to copy and use this, but be prepared to extend and modify it in order to make it useful for your own project. There isn't likely to be a clean path to upgrade your projects as this thing evolves - my assumption is that nobody else is directly depending on this code or the gems I've published from it.
|
8
|
+
|
9
|
+
I'm using [spin-stack-network](https://github.com/cloudspinners/spin-stack-network) as an example of an infrastructure stack project to make use of this framework. I may add other projects in the future as the tool is developed.
|
4
10
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
11
|
|
7
12
|
## Installation
|
8
13
|
|
@@ -14,15 +19,75 @@ gem 'cloudspin-stack-rake'
|
|
14
19
|
|
15
20
|
And then execute:
|
16
21
|
|
17
|
-
|
22
|
+
```bash
|
23
|
+
bundle
|
24
|
+
```
|
18
25
|
|
19
26
|
Or install it yourself as:
|
20
27
|
|
21
|
-
|
28
|
+
```bash
|
29
|
+
gem install cloudspin-stack-rake
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage: Stack management
|
22
33
|
|
23
|
-
|
34
|
+
Here's a snippet from a Rakefile:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'cloudspin/stack/rake'
|
38
|
+
|
39
|
+
namespace :stack do
|
40
|
+
namespace 'test-network' do
|
41
|
+
Cloudspin::Stack::Rake::StackTask.new(id: 'test-network')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
If you run `rake -T` you'll see a list of tasks:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
rake stack:test-network:down # Destroy stack test-network
|
50
|
+
rake stack:test-network:dry # Show command line to be run for stack test-network
|
51
|
+
rake stack:test-network:plan # Plan changes to stack test-network
|
52
|
+
rake stack:test-network:up # Create or update stack test-network
|
53
|
+
```
|
54
|
+
|
55
|
+
You can also add inspec test tasks. The Rakefile snippet:
|
56
|
+
```ruby
|
57
|
+
require 'cloudspin/stack/rake'
|
58
|
+
|
59
|
+
namespace :stack do
|
60
|
+
namespace 'test-network' do
|
61
|
+
stack = Cloudspin::Stack::Rake::StackTask.new(id: 'test-network').instance
|
62
|
+
Cloudspin::Stack::Rake::InspecTask.new(stack_instance: stack,
|
63
|
+
inspec_target: 'aws://eu-west-1/assume-spin_stack_manager-skeleton')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
This includes the stack management tasks from the first example, but adds a new one when you run `rake -T`:
|
69
|
+
|
70
|
+
```bash
|
71
|
+
rake stack:test-network:inspec # Run inspec tests
|
72
|
+
```
|
73
|
+
|
74
|
+
This assumes you have a folder `./inspec` with profile and controls in it.
|
75
|
+
|
76
|
+
For convenience, you can add a top level task to your Rakefile that creates a stack, runs inspec, and then destroys it:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
desc 'Create, test, and destroy the stack'
|
80
|
+
task :full_test => [
|
81
|
+
:'stack:test-network:up',
|
82
|
+
:'stack:test-network:inspec',
|
83
|
+
:'stack:test-network:down'
|
84
|
+
]
|
85
|
+
```
|
86
|
+
|
87
|
+
You can then simply run `rake full_test` to do this.
|
88
|
+
|
89
|
+
Again, [spin-stack-network](https://github.com/cloudspinners/spin-stack-network) has an example of this, and is likely to move ahead of this documentation.
|
24
90
|
|
25
|
-
TODO: Write usage instructions here
|
26
91
|
|
27
92
|
## Development
|
28
93
|
|
@@ -33,3 +98,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
33
98
|
## Contributing
|
34
99
|
|
35
100
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cloudspin-stack-rake.
|
101
|
+
|
102
|
+
# Credits
|
103
|
+
|
104
|
+
This project makes extensive use of ideas and code from Toby Clemson and Jimmy Thompson, particularly [infrablocks](https://github.com/infrablocks). I've also benefited from feedback on implementation concepts from Vincenzo Fabrizi, and other [ThoughtWorkers](https://thoughtworks.com).
|
105
|
+
|
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_dependency 'cloudspin-stack'
|
27
27
|
spec.add_dependency 'inspec'
|
28
|
+
spec.add_dependency 'rake'
|
28
29
|
|
29
|
-
spec.add_development_dependency 'bundler'
|
30
|
-
spec.add_development_dependency '
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
+
spec.add_development_dependency 'bundler'
|
31
|
+
# spec.add_development_dependency 'rspec'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudspin-stack-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 'kief '
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cloudspin-stack
|
@@ -38,48 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.16'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.16'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
62
|
-
type: :
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: bundler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
68
|
+
version: '0'
|
83
69
|
description:
|
84
70
|
email:
|
85
71
|
- cloudspin@kief.com
|