bosh-cloudfoundry 0.7.0.alpha.5 → 0.7.0.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ The rewrite introduces some new implementation/feature concepts:
16
16
 
17
17
  * using `bosh diff` (aka biff) to generate the deployment file
18
18
  * bundles all final releases into the project & distributed rubygem/plugin (no runtime dependency on cf-release git repository; only the public blobstore)
19
- * templates are versioned for the final releases
19
+ * templates are versioned for each final release (unless new templates not required for new release)
20
20
  * different sizes of deployments (orders of magnitude), such as small, medium & large
21
21
 
22
22
  The latter means that new versions of this rubygem can be published that are backwards compatible with aging deployments of Cloud Foundry. There should not be any forced coupling of old `bosh-cloudfoundry` to old `cf-release` final releases.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "bosh-cloudfoundry"
5
- spec.version = "0.7.0.alpha.5"
5
+ spec.version = "0.7.0.alpha.6"
6
6
  spec.authors = ["Dr Nic Williams"]
7
7
  spec.email = ["drnicwilliams@gmail.com"]
8
8
  spec.description = %q{Create & manage Cloud Foundry deployments}
@@ -20,5 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "rake"
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rspec", "~> 2.13.0"
23
+ spec.add_development_dependency "rspec-fire"
23
24
  spec.add_development_dependency "fakeweb"
24
25
  end
@@ -22,9 +22,13 @@ module Bosh::Cli::Command
22
22
  desc "upload latest Cloud Foundry release to bosh"
23
23
  def prepare_cf
24
24
  auth_required
25
+ bosh_status # preload
25
26
 
26
27
  release_yml = Dir[File.join(bosh_release_dir, "releases", "*-#{latest_release_version}.yml")].first
27
28
  release_cmd(non_interactive: true).upload(release_yml)
29
+
30
+ stemcell_url = "http://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-stemcell/#{bosh_cpi}/latest-bosh-stemcell-#{bosh_cpi}.tgz"
31
+ stemcell_cmd(non_interactive: true).upload(stemcell_url)
28
32
  end
29
33
 
30
34
  usage "create cf"
@@ -161,5 +165,22 @@ module Bosh::Cli::Command
161
165
  def bosh_cpi
162
166
  bosh_status["cpi"]
163
167
  end
168
+
169
+ # TODO move into PrepareBosh class
170
+ def release_cmd(options = {})
171
+ cmd ||= Bosh::Cli::Command::Release.new
172
+ options.each do |key, value|
173
+ cmd.add_option key.to_sym, value
174
+ end
175
+ cmd
176
+ end
177
+
178
+ def stemcell_cmd(options = {})
179
+ cmd ||= Bosh::Cli::Command::Stemcell.new
180
+ options.each do |key, value|
181
+ cmd.add_option key.to_sym, value
182
+ end
183
+ cmd
184
+ end
164
185
  end
165
186
  end
@@ -33,7 +33,7 @@ compilation:
33
33
  resource_pools:
34
34
  - name: small
35
35
  network: default
36
- size: 3
36
+ size: 4
37
37
  stemcell:
38
38
  name: bosh-stemcell
39
39
  version: latest
@@ -42,7 +42,7 @@ resource_pools:
42
42
 
43
43
  - name: medium
44
44
  network: default
45
- size: 2
45
+ size: 1
46
46
  stemcell:
47
47
  name: bosh-stemcell
48
48
  version: latest
@@ -99,7 +99,7 @@ jobs:
99
99
  - cloud_controller_ng
100
100
  - gorouter
101
101
  instances: 1
102
- resource_pool: medium
102
+ resource_pool: small
103
103
  networks:
104
104
  - name: default
105
105
  default:
@@ -1,5 +1,4 @@
1
1
  require "bosh/cli/commands/cf"
2
- require "fakeweb"
3
2
 
4
3
  describe Bosh::Cli::Command::CloudFoundry do
5
4
  include FileUtils
@@ -12,7 +11,6 @@ describe Bosh::Cli::Command::CloudFoundry do
12
11
  end
13
12
 
14
13
  before { setup_home_dir }
15
- before { FakeWeb.allow_net_connect = false }
16
14
 
17
15
  it "shows help" do
18
16
  subject.cf_help
@@ -23,15 +21,24 @@ describe Bosh::Cli::Command::CloudFoundry do
23
21
  command.add_option(:config, home_file(".bosh_config"))
24
22
  command.add_option(:non_interactive, true)
25
23
  command.should_receive(:auth_required)
24
+
25
+ director = instance_double("Bosh::Cli::Director")
26
+ director.should_receive(:get_status).and_return({"uuid" => "UUID", "cpi" => "aws"})
27
+ command.stub(:director_client).and_return(director)
26
28
  end
27
29
 
28
30
  context "director does not already have release" do
29
31
  it "upload release" do
30
32
  release_yml = File.expand_path("../../bosh_release/releases/cf-release-133.yml", __FILE__)
31
- release_cmd = mock("release_cmd")
33
+ release_cmd = instance_double("Bosh::Cli::Command::Release")
32
34
  release_cmd.should_receive(:upload).with(release_yml)
33
35
  command.stub(:release_cmd).and_return(release_cmd)
34
36
 
37
+ aws_full_stemcell_url = "http://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-stemcell/aws/latest-bosh-stemcell-aws.tgz"
38
+ stemcell_cmd = instance_double("Bosh::Cli::Command::Stemcell")
39
+ stemcell_cmd.should_receive(:upload).with(aws_full_stemcell_url)
40
+ command.stub(:stemcell_cmd).and_return(stemcell_cmd)
41
+
35
42
  command.prepare_cf
36
43
  end
37
44
  end
@@ -42,16 +49,23 @@ describe Bosh::Cli::Command::CloudFoundry do
42
49
  end
43
50
 
44
51
  context "create cf" do
45
- it "requires --ip 1.2.3.4" do
46
- command.add_option(:dns, "mycloud.com")
47
- command.add_option(:size, "xlarge")
48
- expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
49
- end
52
+ context "validation failures" do
53
+ before do
54
+ director = instance_double("Bosh::Cli::Director")
55
+ director.stub(:get_status).and_return({"uuid" => "UUID", "cpi" => "aws"})
56
+ command.stub(:director_client).and_return(director)
57
+ end
58
+ it "requires --ip 1.2.3.4" do
59
+ command.add_option(:dns, "mycloud.com")
60
+ command.add_option(:size, "xlarge")
61
+ expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
62
+ end
50
63
 
51
- it "requires --dns" do
52
- command.add_option(:ip, ["1.2.3.4"])
53
- command.add_option(:size, "xlarge")
54
- expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
64
+ it "requires --dns" do
65
+ command.add_option(:ip, ["1.2.3.4"])
66
+ command.add_option(:size, "xlarge")
67
+ expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
68
+ end
55
69
  end
56
70
 
57
71
  context "with requirements" do
@@ -65,7 +79,7 @@ describe Bosh::Cli::Command::CloudFoundry do
65
79
 
66
80
  command.should_receive(:auth_required)
67
81
 
68
- director = mock("director_client")
82
+ director = instance_double("Bosh::Cli::Director")
69
83
  director.should_receive(:get_status).and_return({"uuid" => "UUID", "cpi" => "aws"})
70
84
  command.stub(:director_client).and_return(director)
71
85
 
@@ -9,6 +9,8 @@ Bundler.setup(:default, :test)
9
9
  $:.unshift(File.expand_path("../../lib", __FILE__))
10
10
 
11
11
  require "rspec/core"
12
+ require 'rspec/fire'
13
+
12
14
  require "tmpdir"
13
15
 
14
16
  # for the #sh helper
@@ -20,6 +22,13 @@ require "cli"
20
22
 
21
23
  require "bosh/cloudfoundry"
22
24
 
25
+ require "fakeweb"
26
+ FakeWeb.allow_net_connect = false
27
+
28
+ RSpec.configure do |config|
29
+ config.include(RSpec::Fire)
30
+ end
31
+
23
32
  # load all files in spec/support/* (but not lower down)
24
33
  Dir[File.dirname(__FILE__) + '/support/*'].each do |path|
25
34
  require path unless File.directory?(path)
@@ -211,7 +211,7 @@ properties:
211
211
  use_datadog: false
212
212
 
213
213
  nfs_server:
214
- address: 0.data.default.<%= name %>.microbosh
214
+ address: 0.core.default.<%= name %>.microbosh
215
215
  #network: "*.<%= name %>.microbosh"
216
216
  #idmapd_domain: <%= dns %>
217
217
 
@@ -220,7 +220,7 @@ properties:
220
220
 
221
221
  databases: &databases
222
222
  db_scheme: postgres
223
- address: 0.data.default.<%= name %>.microbosh
223
+ address: 0.core.default.<%= name %>.microbosh
224
224
  port: 5524
225
225
  roles:
226
226
  - tag: admin
@@ -239,7 +239,7 @@ properties:
239
239
 
240
240
  ccdb: &ccdb
241
241
  db_scheme: postgres
242
- address: 0.data.default.<%= name %>.microbosh
242
+ address: 0.core.default.<%= name %>.microbosh
243
243
  port: 5524
244
244
  roles:
245
245
  - tag: admin
@@ -254,7 +254,7 @@ properties:
254
254
 
255
255
  uaadb:
256
256
  db_scheme: postgresql
257
- address: 0.data.default.<%= name %>.microbosh
257
+ address: 0.core.default.<%= name %>.microbosh
258
258
  port: 5524
259
259
  roles:
260
260
  - tag: admin
@@ -68,7 +68,7 @@ compilation:
68
68
  resource_pools:
69
69
  - name: small
70
70
  network: default
71
- size: 3
71
+ size: 4
72
72
  stemcell:
73
73
  name: bosh-stemcell
74
74
  version: latest
@@ -77,7 +77,7 @@ resource_pools:
77
77
 
78
78
  - name: medium
79
79
  network: default
80
- size: 2
80
+ size: 1
81
81
  stemcell:
82
82
  name: bosh-stemcell
83
83
  version: latest
@@ -134,7 +134,7 @@ jobs:
134
134
  - cloud_controller_ng
135
135
  - gorouter
136
136
  instances: 1
137
- resource_pool: medium
137
+ resource_pool: small
138
138
  networks:
139
139
  - name: default
140
140
  default:
@@ -68,7 +68,7 @@ compilation:
68
68
  resource_pools:
69
69
  - name: small
70
70
  network: default
71
- size: 2
71
+ size: 4
72
72
  stemcell:
73
73
  name: bosh-stemcell
74
74
  version: latest
@@ -77,7 +77,7 @@ resource_pools:
77
77
 
78
78
  - name: medium
79
79
  network: default
80
- size: 2
80
+ size: 1
81
81
  stemcell:
82
82
  name: bosh-stemcell
83
83
  version: latest
@@ -85,26 +85,37 @@ resource_pools:
85
85
  instance_type: m1.medium
86
86
 
87
87
  jobs:
88
+ - name: data
89
+ release: cf-release
90
+ template:
91
+ - postgres
92
+ - debian_nfs_server
93
+ instances: 1
94
+ resource_pool: small
95
+ persistent_disk: <%= persistent_disk %>
96
+ networks:
97
+ - name: default
98
+ default:
99
+ - dns
100
+ - gateway
101
+ properties:
102
+ db: databases
103
+
88
104
  - name: core
89
105
  release: cf-release
90
106
  template:
91
107
  - syslog_aggregator
92
108
  - nats
93
- - postgres
94
109
  - health_manager_next
95
110
  - collector
96
- - debian_nfs_server
97
111
  - login
98
112
  instances: 1
99
113
  resource_pool: medium
100
- persistent_disk: <%= persistent_disk %>
101
114
  networks:
102
115
  - name: default
103
116
  default:
104
117
  - dns
105
118
  - gateway
106
- properties:
107
- db: databases
108
119
 
109
120
  # need a separate job for uaa due to https://github.com/cloudfoundry/cf-release/issues/104
110
121
  - name: uaa
@@ -123,7 +134,7 @@ jobs:
123
134
  - cloud_controller_ng
124
135
  - gorouter
125
136
  instances: 1
126
- resource_pool: medium
137
+ resource_pool: small
127
138
  networks:
128
139
  - name: default
129
140
  default:
@@ -211,7 +222,7 @@ properties:
211
222
  use_datadog: false
212
223
 
213
224
  nfs_server:
214
- address: 0.core.default.<%= name %>.microbosh
225
+ address: 0.data.default.<%= name %>.microbosh
215
226
  #network: "*.<%= name %>.microbosh"
216
227
  #idmapd_domain: <%= dns %>
217
228
 
@@ -220,7 +231,7 @@ properties:
220
231
 
221
232
  databases: &databases
222
233
  db_scheme: postgres
223
- address: 0.core.default.<%= name %>.microbosh
234
+ address: 0.data.default.<%= name %>.microbosh
224
235
  port: 5524
225
236
  roles:
226
237
  - tag: admin
@@ -239,7 +250,7 @@ properties:
239
250
 
240
251
  ccdb: &ccdb
241
252
  db_scheme: postgres
242
- address: 0.core.default.<%= name %>.microbosh
253
+ address: 0.data.default.<%= name %>.microbosh
243
254
  port: 5524
244
255
  roles:
245
256
  - tag: admin
@@ -254,7 +265,7 @@ properties:
254
265
 
255
266
  uaadb:
256
267
  db_scheme: postgresql
257
- address: 0.core.default.<%= name %>.microbosh
268
+ address: 0.data.default.<%= name %>.microbosh
258
269
  port: 5524
259
270
  roles:
260
271
  - tag: admin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-cloudfoundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.alpha.5
4
+ version: 0.7.0.alpha.6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -75,6 +75,22 @@ dependencies:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 2.13.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-fire
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
78
94
  - !ruby/object:Gem::Dependency
79
95
  name: fakeweb
80
96
  requirement: !ruby/object:Gem::Requirement
@@ -456,7 +472,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
456
472
  version: '0'
457
473
  segments:
458
474
  - 0
459
- hash: -4043648917353129652
475
+ hash: 4430002613479451948
460
476
  required_rubygems_version: !ruby/object:Gem::Requirement
461
477
  none: false
462
478
  requirements: