bosh-bootstrap 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -2
- data/ChangeLog.md +2 -1
- data/README.md +12 -10
- data/TODO.md +2 -0
- data/bin/bosh-bootstrap +8 -0
- data/bosh-bootstrap.gemspec +3 -2
- data/lib/bosh-bootstrap/thor_cli.rb +28 -0
- data/lib/bosh-bootstrap/version.rb +1 -1
- data/spec/spec_helper.rb +8 -2
- data/spec/unit/cli/bootstrap_spec.rb +40 -32
- data/spec/unit/commands/deploy_spec.rb +0 -2
- data/spec/unit/key_pair_spec.rb +2 -0
- data/spec/unit/microbosh_providers/aws_spec.rb +1 -1
- data/spec/unit/microbosh_providers/openstack_spec.rb +1 -1
- data/spec/unit/microbosh_providers/vsphere_spec.rb +1 -1
- data/spec/unit/network_providers/aws_spec.rb +1 -0
- data/spec/unit/network_spec.rb +2 -0
- metadata +33 -14
data/.travis.yml
CHANGED
@@ -2,8 +2,8 @@ language: ruby
|
|
2
2
|
script: bundle exec rake spec:$SUITE
|
3
3
|
rvm:
|
4
4
|
- ruby-1.9.3
|
5
|
-
|
6
|
-
|
5
|
+
- rbx-19mode
|
6
|
+
- ruby-2.0.0
|
7
7
|
notifications:
|
8
8
|
email:
|
9
9
|
recipients:
|
@@ -21,5 +21,7 @@ env:
|
|
21
21
|
- secure: "OS3pnXOAVRP0QPDl/Nn/0iBPZbrnn9irFYwEbMJ2fGPsV00u4IYDwoIN5Gzb\nX+cXyiPZB0jdQlbiCMaQEYjYig3fgnDhiLj/MnxkVYtILm+0uPSrX2Zf7jvR\nmxCT5jfTSZoPXQeNi9h8rEqvaqKv4z930xp/Z0QNoZLPWdwY5wk="
|
22
22
|
matrix:
|
23
23
|
allow_failures:
|
24
|
+
# - rvm: rbx-19mode
|
25
|
+
# - rvm: ruby-2.0.0
|
24
26
|
- env: SUITE=integration:aws:basic
|
25
27
|
|
data/ChangeLog.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
`bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on AWS (with OpenStack & vSphere coming soon).
|
4
4
|
|
5
5
|
gem install bosh-bootstrap
|
6
|
-
bosh
|
6
|
+
bosh-bootstrap deploy
|
7
7
|
|
8
8
|
## v0.11
|
9
9
|
|
@@ -17,6 +17,7 @@
|
|
17
17
|
* CLI via bosh plugin (`bosh bootstrap`) rather than a stand alone CLI (`bosh-bootstrap`)
|
18
18
|
* Added `ssh` action to ssh into the microbosh
|
19
19
|
* Added `delete` actions to delete the microbosh (but not the IP address and security groups)
|
20
|
+
* Add back `bosh-bootstrap` CLI & remove bosh_cli dependency (v0.11.1)
|
20
21
|
|
21
22
|
## v0.10
|
22
23
|
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Bosh Bootstrap currently supports AWS, with OpenStack and vSphere coming soon. T
|
|
13
13
|
It also performs the task as fast as it is possible. On AWS, if a public AMI has been published for your requested region then it will use that (currently: us-east-1/Virginia).
|
14
14
|
|
15
15
|
```
|
16
|
-
$ bosh
|
16
|
+
$ bosh-bootstrap deploy
|
17
17
|
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
|
18
18
|
1. AWS (default)
|
19
19
|
2. AWS (bosh)
|
@@ -46,7 +46,7 @@ Confirming: Using address 107.21.194.123
|
|
46
46
|
Generating ~/.bosh-bootstrap/universes/aws-us-east-1/micro_bosh.yml...
|
47
47
|
Deploying micro bosh server...
|
48
48
|
|
49
|
-
$ bosh
|
49
|
+
$ bosh-bootstrap ssh
|
50
50
|
SSH to micro bosh server...
|
51
51
|
|
52
52
|
$ bosh-bootstrap delete
|
@@ -71,12 +71,14 @@ $ gem install bosh-bootstrap
|
|
71
71
|
|
72
72
|
## Usage
|
73
73
|
|
74
|
+
Bosh Bootstrap is available primarily as a standalone CLI `bosh-bootstrap`. If you have the bosh CLI installed, then it is also available as a bosh plugin via `bosh bootstrap`. This readme assumes the former usage.
|
75
|
+
|
74
76
|
### First time usage
|
75
77
|
|
76
78
|
The first time you use `bosh bootstrap` it will create everything necessary, including a public IP address, security groups, a private key, and the all-important micro bosh that you want. The example output below includes user prompts.
|
77
79
|
|
78
80
|
```
|
79
|
-
$ bosh
|
81
|
+
$ bosh-bootstrap deploy
|
80
82
|
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
|
81
83
|
1. AWS (default)
|
82
84
|
2. AWS (bosh)
|
@@ -161,22 +163,22 @@ The `deploy` command can be re-run and it will not prompt again for inputs. It a
|
|
161
163
|
You can open an SSH shell to your micro bosh:
|
162
164
|
|
163
165
|
```
|
164
|
-
$ bosh
|
166
|
+
$ bosh-bootstrap ssh
|
165
167
|
```
|
166
168
|
|
167
169
|
## Deleting micro bosh
|
168
170
|
|
169
|
-
The `bosh
|
171
|
+
The `bosh-bootstrap delete` command will delete the target micro-bosh.
|
170
172
|
|
171
173
|
```
|
172
|
-
$ bosh
|
174
|
+
$ bosh-bootstrap delete
|
173
175
|
```
|
174
176
|
|
175
177
|
## Deep dive into the Bosh Bootstrap deploy command
|
176
178
|
|
177
|
-
What is actually happening when you run `bosh
|
179
|
+
What is actually happening when you run `bosh-bootstrap deploy`?
|
178
180
|
|
179
|
-
At the heart of `bosh
|
181
|
+
At the heart of `bosh-bootstrap deploy` is the execution of the micro bosh deployer, a bosh plugin provided to bootstrap a single VM with all the parts of bosh running on it. If you ran this command yourself you would run:
|
180
182
|
|
181
183
|
```
|
182
184
|
$ gem install bosh_cli_plugin_micro -s https://s3.amazonaws.com/bosh-jenkins-gems/
|
@@ -190,7 +192,7 @@ Unfortunately for this simple scenario, there are many little prerequisite steps
|
|
190
192
|
* publicly available stemcells
|
191
193
|
* custom stemcells generated from the bosh repository.
|
192
194
|
|
193
|
-
To understand exactly what the `bosh
|
195
|
+
To understand exactly what the `bosh-bootstrap deploy` command is doing, let's start with what the running parts of bosh are and how `bosh micro deploy` deploys them.
|
194
196
|
|
195
197
|
### What is in bosh?
|
196
198
|
|
@@ -268,7 +270,7 @@ One of the feature of the Bosh Bootstrap is that you can run it from your local
|
|
268
270
|
|
269
271
|
### When do I need an inception server?
|
270
272
|
|
271
|
-
There are occasions when it is preferable or required to provision a initial server (called an [inception server](https://github.com/drnic/inception-server)) and to run Bosh Bootstrap (`bosh
|
273
|
+
There are occasions when it is preferable or required to provision a initial server (called an [inception server](https://github.com/drnic/inception-server)) and to run Bosh Bootstrap (`bosh-bootstrap deploy`) within that.
|
272
274
|
|
273
275
|
* Using a AWS region other than us-east-1 (you need to be in that region to create an AMI)
|
274
276
|
* You want much faster internet between your terminal (an ssh session into your inception server) and your micro bosh and deployed servers
|
data/TODO.md
CHANGED
data/bin/bosh-bootstrap
ADDED
data/bosh-bootstrap.gemspec
CHANGED
@@ -22,10 +22,11 @@ EOS
|
|
22
22
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
23
23
|
gem.require_paths = ["lib"]
|
24
24
|
|
25
|
-
gem.add_dependency "cyoi"
|
25
|
+
gem.add_dependency "cyoi", "~> 0.4"
|
26
|
+
gem.add_dependency "fog", "~> 1.11"
|
26
27
|
gem.add_dependency "readwritesettings", "~> 3.0"
|
28
|
+
gem.add_dependency "thor", "~> 0.18"
|
27
29
|
gem.add_dependency "redcard"
|
28
|
-
gem.add_dependency "bosh_cli"
|
29
30
|
gem.add_development_dependency "rake"
|
30
31
|
gem.add_development_dependency "rspec"
|
31
32
|
gem.add_development_dependency "fakeweb"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "bosh-bootstrap"
|
3
|
+
|
4
|
+
module Bosh::Bootstrap
|
5
|
+
class ThorCli < Thor
|
6
|
+
|
7
|
+
desc "deploy", "Configure and bootstrap a micro bosh; or deploy/upgrade existing Micro Bosh"
|
8
|
+
def deploy
|
9
|
+
require "bosh-bootstrap/cli/commands/deploy"
|
10
|
+
deploy_cmd = Bosh::Bootstrap::Cli::Commands::Deploy.new
|
11
|
+
deploy_cmd.perform
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "ssh", "SSH into micro bosh"
|
15
|
+
def ssh
|
16
|
+
require "bosh-bootstrap/cli/commands/ssh"
|
17
|
+
cmd = Bosh::Bootstrap::Cli::Commands::SSH.new
|
18
|
+
cmd.perform
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "delete", "Delete existing Micro Bosh (does not delete any bosh deployments running)"
|
22
|
+
def delete
|
23
|
+
require "bosh-bootstrap/cli/commands/delete"
|
24
|
+
cmd = Bosh::Bootstrap::Cli::Commands::Delete.new
|
25
|
+
cmd.perform
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,8 +9,8 @@ Bundler.setup(:default, :test)
|
|
9
9
|
$:.unshift(File.expand_path("../../lib", __FILE__))
|
10
10
|
|
11
11
|
require "rspec/core"
|
12
|
-
require "
|
13
|
-
require "bosh
|
12
|
+
require "tmpdir"
|
13
|
+
require "bosh-bootstrap"
|
14
14
|
require "bosh-bootstrap/cli/helpers"
|
15
15
|
|
16
16
|
# for the #sh helper
|
@@ -32,6 +32,12 @@ def files_match(filename, expected_filename)
|
|
32
32
|
file.should == expected_file
|
33
33
|
end
|
34
34
|
|
35
|
+
def yaml_files_match(filename, expected_filename)
|
36
|
+
yaml = YAML.load_file(filename)
|
37
|
+
expected_yaml = YAML.load_file(expected_filename)
|
38
|
+
yaml.should == expected_yaml
|
39
|
+
end
|
40
|
+
|
35
41
|
def setup_home_dir
|
36
42
|
home_dir = File.expand_path("../../tmp/home", __FILE__)
|
37
43
|
FileUtils.rm_rf(home_dir)
|
@@ -1,41 +1,49 @@
|
|
1
1
|
# Copyright (c) 2012-2013 Stark & Wayne, LLC
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
# By default, this bosh plugin test does not run. To enable it, include the `bosh_cli` gem
|
4
|
+
# in the Gemfile.
|
5
|
+
begin
|
6
|
+
require "cli" # bosh CLI
|
7
|
+
require "bosh/cli/commands/bootstrap" # "bosh bootstrap COMMAND" commands added to bosh CLI
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
require "bosh-bootstrap/cli/commands/deploy"
|
10
|
+
require "bosh-bootstrap/cli/commands/delete"
|
11
|
+
require "bosh-bootstrap/cli/commands/ssh"
|
12
|
+
describe Bosh::Cli::Command::Bootstrap do
|
13
|
+
include FileUtils
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
cli
|
19
|
-
end
|
15
|
+
before do
|
16
|
+
FileUtils.mkdir_p(@stemcells_dir = File.join(Dir.mktmpdir, "stemcells"))
|
17
|
+
FileUtils.mkdir_p(@cache_dir = File.join(Dir.mktmpdir, "cache"))
|
18
|
+
end
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
let(:cli) do
|
21
|
+
cli = Bosh::Cli::Command::Bootstrap.new(nil)
|
22
|
+
cli.add_option(:non_interactive, true)
|
23
|
+
cli.add_option(:cache_dir, @cache_dir)
|
24
|
+
cli
|
25
|
+
end
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
it "runs deploy command" do
|
28
|
+
cmd = double(Bosh::Bootstrap::Cli::Commands::Deploy)
|
29
|
+
cmd.should_receive(:perform)
|
30
|
+
Bosh::Bootstrap::Cli::Commands::Deploy.stub(:new).and_return(cmd)
|
31
|
+
cli.deploy
|
32
|
+
end
|
33
|
+
|
34
|
+
it "runs delete command" do
|
35
|
+
cmd = double(Bosh::Bootstrap::Cli::Commands::Delete)
|
36
|
+
cmd.should_receive(:perform)
|
37
|
+
Bosh::Bootstrap::Cli::Commands::Delete.stub(:new).and_return(cmd)
|
38
|
+
cli.delete
|
39
|
+
end
|
34
40
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
41
|
+
it "runs ssh command" do
|
42
|
+
cmd = double(Bosh::Bootstrap::Cli::Commands::SSH)
|
43
|
+
cmd.should_receive(:perform)
|
44
|
+
Bosh::Bootstrap::Cli::Commands::SSH.stub(:new).and_return(cmd)
|
45
|
+
cli.ssh
|
46
|
+
end
|
40
47
|
end
|
48
|
+
rescue LoadError
|
41
49
|
end
|
data/spec/unit/key_pair_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe Bosh::Bootstrap::MicroboshProviders::AWS do
|
|
25
25
|
|
26
26
|
subject.create_microbosh_yml(settings)
|
27
27
|
File.should be_exists(microbosh_yml)
|
28
|
-
|
28
|
+
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.aws_ec2.yml"))
|
29
29
|
end
|
30
30
|
|
31
31
|
describe "stemcell" do
|
@@ -22,6 +22,6 @@ describe Bosh::Bootstrap::MicroboshProviders::OpenStack do
|
|
22
22
|
|
23
23
|
subject.create_microbosh_yml(settings)
|
24
24
|
File.should be_exists(microbosh_yml)
|
25
|
-
|
25
|
+
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.yml"))
|
26
26
|
end
|
27
27
|
end
|
@@ -37,6 +37,6 @@ describe Bosh::Bootstrap::MicroboshProviders::VSphere do
|
|
37
37
|
|
38
38
|
subject.create_microbosh_yml(settings)
|
39
39
|
File.should be_exists(microbosh_yml)
|
40
|
-
|
40
|
+
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.vsphere.yml"))
|
41
41
|
end
|
42
42
|
end
|
data/spec/unit/network_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cyoi
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
21
|
+
version: '0.4'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
29
|
+
version: '0.4'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: fog
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.11'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.11'
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: readwritesettings
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,23 +60,23 @@ dependencies:
|
|
44
60
|
- !ruby/object:Gem::Version
|
45
61
|
version: '3.0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
63
|
+
name: thor
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
49
65
|
none: false
|
50
66
|
requirements:
|
51
|
-
- -
|
67
|
+
- - ~>
|
52
68
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
69
|
+
version: '0.18'
|
54
70
|
type: :runtime
|
55
71
|
prerelease: false
|
56
72
|
version_requirements: !ruby/object:Gem::Requirement
|
57
73
|
none: false
|
58
74
|
requirements:
|
59
|
-
- -
|
75
|
+
- - ~>
|
60
76
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
77
|
+
version: '0.18'
|
62
78
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
79
|
+
name: redcard
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
65
81
|
none: false
|
66
82
|
requirements:
|
@@ -126,7 +142,8 @@ dependencies:
|
|
126
142
|
description: Bootstrap a micro bosh universe from one CLI
|
127
143
|
email:
|
128
144
|
- drnicwilliams@gmail.com
|
129
|
-
executables:
|
145
|
+
executables:
|
146
|
+
- bosh-bootstrap
|
130
147
|
extensions: []
|
131
148
|
extra_rdoc_files: []
|
132
149
|
files:
|
@@ -140,6 +157,7 @@ files:
|
|
140
157
|
- README.md
|
141
158
|
- Rakefile
|
142
159
|
- TODO.md
|
160
|
+
- bin/bosh-bootstrap
|
143
161
|
- bosh-bootstrap.gemspec
|
144
162
|
- lib/bosh-bootstrap.rb
|
145
163
|
- lib/bosh-bootstrap/cli/commands/delete.rb
|
@@ -161,6 +179,7 @@ files:
|
|
161
179
|
- lib/bosh-bootstrap/network_providers/aws.rb
|
162
180
|
- lib/bosh-bootstrap/network_providers/dummy.rb
|
163
181
|
- lib/bosh-bootstrap/network_providers/openstack.rb
|
182
|
+
- lib/bosh-bootstrap/thor_cli.rb
|
164
183
|
- lib/bosh-bootstrap/version.rb
|
165
184
|
- lib/bosh/cli/commands/bootstrap.rb
|
166
185
|
- spec/assets/.gitkeep
|
@@ -206,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
225
|
version: '0'
|
207
226
|
segments:
|
208
227
|
- 0
|
209
|
-
hash:
|
228
|
+
hash: -2381433706831646133
|
210
229
|
requirements: []
|
211
230
|
rubyforge_project:
|
212
231
|
rubygems_version: 1.8.25
|