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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe9ba3e570aa2008c15f9eca66f85ce4c06ca468
4
- data.tar.gz: 61a5bd4a590b2a0131e10f7513b3a37d4b459461
3
+ metadata.gz: 48a762fa668954ea8c6a3bae358fd753cad751f3
4
+ data.tar.gz: 73c434c312c348befa9476d0c9c1bee63b855aa8
5
5
  SHA512:
6
- metadata.gz: 349d7372f8eb066d55f6d71c8086c3718c5b8e83ffe957d3dd55d75c5e9478bbbf65f63afe0ba5a3a555ff0988781a5ab19f8cee972baecdeb25752ea438f12f
7
- data.tar.gz: db16be4b74cc8f32f8ac7b866c901ee78d0c269d79b2e52406125e1c6185bffcae06076c902b5b187e493991f22633e9e55e4d959b9a3e16f348905e28ef4c17
6
+ metadata.gz: e8ad920721a2898c45de0509b1e8d94230b000eddcc4a3dc5af90d643b9b2e091174a6a9c5fa5b4aed1dbfcb5bbeb266c8e2c5cca137aa104a70a23007725fd8
7
+ data.tar.gz: 400c22aa72b3e3ea04371f2a2afc97191d246273a40d3e13cb24d4683422de482dba423df53389a365a170f55ba8e93a81c5f9263fc208a4ed6068f7042b6586
@@ -1,3 +1,3 @@
1
1
  module PcfBlueGreen
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -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.7
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-02 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout