pcf_blue_green 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/pcf_blue_green/version.rb +1 -1
- data/lib/pcf_blue_green.rb +23 -1
- 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: 48a762fa668954ea8c6a3bae358fd753cad751f3
|
4
|
+
data.tar.gz: 73c434c312c348befa9476d0c9c1bee63b855aa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8ad920721a2898c45de0509b1e8d94230b000eddcc4a3dc5af90d643b9b2e091174a6a9c5fa5b4aed1dbfcb5bbeb266c8e2c5cca137aa104a70a23007725fd8
|
7
|
+
data.tar.gz: 400c22aa72b3e3ea04371f2a2afc97191d246273a40d3e13cb24d4683422de482dba423df53389a365a170f55ba8e93a81c5f9263fc208a4ed6068f7042b6586
|
data/lib/pcf_blue_green.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "pcf_blue_green/version"
|
2
2
|
require 'mixlib/shellout'
|
3
3
|
require 'shellwords'
|
4
|
-
|
4
|
+
require "json"
|
5
5
|
|
6
6
|
module PcfBlueGreen
|
7
7
|
class BlueGreenDeployFailed < StandardError
|
@@ -22,6 +22,28 @@ module PcfBlueGreen
|
|
22
22
|
raise PcfBlueGreen::BlueGreenDeployFailed unless status
|
23
23
|
end
|
24
24
|
|
25
|
+
def env_var_manifest_update
|
26
|
+
bash("#{@source_cmd} && cf-setup")
|
27
|
+
manifest_file_path = ENV['cf_manifest']
|
28
|
+
app = ENV['cf_app']
|
29
|
+
tmp_json =''
|
30
|
+
|
31
|
+
command = 'cf curl /v2/apps'
|
32
|
+
shell = Mixlib::ShellOut.new(command)
|
33
|
+
shell.run_command
|
34
|
+
tmp_stdout = JSON.parse(shell.stdout)
|
35
|
+
|
36
|
+
tmp_stdout['resources'].each do |resource|
|
37
|
+
tmp_json = resource if resource['entity']['name'] == app
|
38
|
+
end
|
39
|
+
environments = tmp_json['entity']['environment_json']
|
40
|
+
open(manifest_file_path, 'a') do |f|
|
41
|
+
environments.each do |env|
|
42
|
+
f.puts "\t\t#{env.join(': ')}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
25
47
|
private
|
26
48
|
|
27
49
|
def bash(command)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pcf_blue_green
|
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
|
- Pawel Bardzinski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|