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 +4 -4
- data/lib/cf/deploy.rb +4 -0
- data/lib/cf/deploy/commands.rb +4 -0
- data/lib/cf/deploy/env_config.rb +5 -0
- data/lib/cf/deploy/version.rb +1 -1
- data/spec/deploy_task_spec.rb +5 -2
- 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: fb1d165a4d99e99afc8b4616b33b8920f02c27b9
|
4
|
+
data.tar.gz: 66ed4f99c235a925ec192531512583f5eaa29cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7fdd5c43a62b582b527c4f07593208b09d1b5ec6f77095cfee7927be60623db11e93f99405d92a0c431e2e6c4a3fb7774f73b3a35e28190e9d73c31bbc075ed
|
7
|
+
data.tar.gz: 3c87bdddfe3a6067ba4d941055bf5723d3a4216524cf1c9c08b8a09a92d6d742787789d42df7be41e9af982527202de77049752738f9943916b94924947fa26a
|
data/lib/cf/deploy.rb
CHANGED
@@ -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
|
|
data/lib/cf/deploy/commands.rb
CHANGED
@@ -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
|
data/lib/cf/deploy/env_config.rb
CHANGED
@@ -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?
|
data/lib/cf/deploy/version.rb
CHANGED
data/spec/deploy_task_spec.rb
CHANGED
@@ -65,7 +65,7 @@ describe CF::Deploy do
|
|
65
65
|
Rake::Task['cf:deploy:test'].invoke
|
66
66
|
end
|
67
67
|
|
68
|
-
it 'should
|
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
|
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.
|
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:
|
12
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|