cf-deploy 0.1.7 → 0.1.8

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: cbe6ee713d98618faadead85006d67ac7c1d4605
4
- data.tar.gz: 99cf899f683d77a983708101a80532a597e698a4
3
+ metadata.gz: fb1d165a4d99e99afc8b4616b33b8920f02c27b9
4
+ data.tar.gz: 66ed4f99c235a925ec192531512583f5eaa29cd0
5
5
  SHA512:
6
- metadata.gz: 89cadfc6b4d7a97b90e58d3764f0c52d13abe3a178a309b51903016a64c098ba8644fda6f943fe774a43b50c0c9d306ad9e6372d60e7a866ebbb888f48ce2e7a
7
- data.tar.gz: 023cd1fd9b7fdd51f8842cc06390bfd95672b61642bc6a8894ecf3558f732f4e319f7bb70bffdd2e02c0563bc90e48a2c71a8efa9a0e6ac1f76a7e06cf2a3dd4
6
+ metadata.gz: b7fdd5c43a62b582b527c4f07593208b09d1b5ec6f77095cfee7927be60623db11e93f99405d92a0c431e2e6c4a3fb7774f73b3a35e28190e9d73c31bbc075ed
7
+ data.tar.gz: 3c87bdddfe3a6067ba4d941055bf5723d3a4216524cf1c9c08b8a09a92d6d742787789d42df7be41e9af982527202de77049752738f9943916b94924947fa26a
@@ -60,6 +60,10 @@ module CF
60
60
  unless env[:runtime_memory].nil? and app[:runtime_memory].nil?
61
61
  cf.scale_memory(app[:name], env[:runtime_memory] || app[:runtime_memory])
62
62
  end
63
+
64
+ unless env[:runtime_instances].nil? and app[:runtime_instances].nil?
65
+ cf.scale_instances(app[:name], env[:runtime_instances] || app[:runtime_instances])
66
+ end
63
67
  end
64
68
  end
65
69
 
@@ -23,6 +23,10 @@ module CF
23
23
  Kernel.system("cf scale #{app_name} -f -m #{memory}")
24
24
  end
25
25
 
26
+ def scale_instances(app_name, instances)
27
+ Kernel.system("cf scale #{app_name} -i #{instances}")
28
+ end
29
+
26
30
  def map_route(route, app_name)
27
31
  Kernel.system(route_cmd(:map, route, app_name))
28
32
  end
@@ -14,6 +14,7 @@ module CF
14
14
  deps: deps,
15
15
  routes: [],
16
16
  runtime_memory: nil,
17
+ runtime_instances: nil,
17
18
  manifests: manifests)
18
19
 
19
20
  instance_eval(&block) if block_given?
@@ -86,6 +87,10 @@ module CF
86
87
  self[:runtime_memory] = memory
87
88
  end
88
89
 
90
+ def runtime_instances(instances)
91
+ self[:runtime_instances] = instances
92
+ end
93
+
89
94
  def route(domain, hostname_or_options = nil, options = nil)
90
95
  if options.nil?
91
96
  if hostname_or_options.nil?
@@ -1,5 +1,5 @@
1
1
  module CF
2
2
  class Deploy
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
5
5
  end
@@ -65,7 +65,7 @@ describe CF::Deploy do
65
65
  Rake::Task['cf:deploy:test'].invoke
66
66
  end
67
67
 
68
- it 'should change memory after deployment if runtime_memory specified in manifest' do
68
+ it 'should scale after deployment if runtime settings specified in manifest' do
69
69
  Dir.chdir('spec/') do
70
70
  described_class.rake_tasks! do
71
71
  environment :staging
@@ -75,14 +75,16 @@ describe CF::Deploy do
75
75
  expect(Kernel).to receive(:system).with('cf login').ordered
76
76
  expect(Kernel).to receive(:system).with('cf push -f manifests/staging_with_runtime.yml').and_return(true).ordered
77
77
  expect(Kernel).to receive(:system).with('cf scale staging-app -f -m 256M').and_return(true).ordered
78
+ expect(Kernel).to receive(:system).with('cf scale staging-app -i 2').and_return(true).ordered
78
79
  Rake::Task['cf:deploy:staging_with_runtime'].invoke
79
80
  end
80
81
 
81
- it 'should change memory after deployment if runtime_memory specified in cf:deploy config' do
82
+ it 'should scale after deployment if runtime settings specified in cf:deploy config' do
82
83
  Dir.chdir('spec/') do
83
84
  described_class.rake_tasks! do
84
85
  environment :staging_with_runtime do
85
86
  runtime_memory '512M'
87
+ runtime_instances 2
86
88
  end
87
89
  end
88
90
  end
@@ -90,6 +92,7 @@ describe CF::Deploy do
90
92
  expect(Kernel).to receive(:system).with('cf login').ordered
91
93
  expect(Kernel).to receive(:system).with('cf push -f manifests/staging_with_runtime.yml').and_return(true).ordered
92
94
  expect(Kernel).to receive(:system).with('cf scale staging-app -f -m 512M').and_return(true).ordered
95
+ expect(Kernel).to receive(:system).with('cf scale staging-app -i 2').and_return(true).ordered
93
96
  Rake::Task['cf:deploy:staging_with_runtime'].invoke
94
97
  end
95
98
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Morton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-02 00:00:00.000000000 Z
12
+ date: 2016-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake