pcf_blue_green 0.27 → 0.28
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/shared-deploy-functions.sh +20 -13
- 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: 327efdf015700c02e2eb763f3c9615f1446efd75
|
4
|
+
data.tar.gz: 7fd129d6e8b35938a45a88e6d1a4ed28d74389f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6a80d063f348fa1c300854bea0bb5b25ea01d5f1bc587cf170e3df03a640a3e03273ec5ef4bec733b065b0c9b707cf0eb329a8c3f7455b385e03871fce573fe
|
7
|
+
data.tar.gz: d5b2b8a3ac2718ddc10a05c36c153b752e7b87571b23a6f24c3bdb71d591711b9c8aa6ccb6321dc1250c3c4413af49764a8171331527a4be503e33dea262c8d5
|
@@ -132,37 +132,44 @@ function remap-routes {
|
|
132
132
|
set -x
|
133
133
|
run-cmd cf routes
|
134
134
|
|
135
|
-
|
135
|
+
# Variables used:
|
136
|
+
|
137
|
+
# Some applications have extra routes that contain paths. If that's the case
|
138
|
+
# then handle_all_green_paths environmental variable is used to manage paths.
|
139
|
+
# to a different hostname
|
140
|
+
|
141
|
+
# Code logic:
|
142
|
+
|
143
|
+
# execute the code below:
|
144
|
+
if [ -z ${handle_all_green_paths+x} ]; then
|
136
145
|
run-cmd cf routes | tail -n +4 | grep ${cf_app} | awk '{print $3" -n "$2}'
|
137
146
|
cf routes | tail -n +4 | grep ${cf_app} | awk '{print $3" -n "$2}' | xargs -n 3 cf map-route ${green}
|
138
147
|
fi
|
139
|
-
|
140
|
-
if [ -n "$sso_hostname" ]; then
|
141
|
-
run-cmd cf routes | tail -n +4 | awk '($2==ENVIRON["sso_hostname"]) && ($5==ENVIRON["cf_app"]) {print $3" -n "$2 " --path "substr($4,2) }'
|
142
|
-
cf routes | tail -n +4 | awk '($2==ENVIRON["sso_hostname"]) && ($5==ENVIRON["cf_app"]) {print $3" -n "$2 " --path "substr($4,2) }' | xargs -n 5 cf map-route ${green}
|
143
|
-
fi
|
144
148
|
|
149
|
+
# if map_main_route environmental variable is set then the main route gets mapped:
|
145
150
|
if [ -n "$map_main_route" ]; then
|
146
|
-
run-cmd cf routes |
|
151
|
+
run-cmd cf routes | awk '($4==ENVIRON["cf_app"]) {print $3" -n " $2 }' | xargs -n 3 cf map-route ${green}
|
147
152
|
fi
|
148
153
|
|
154
|
+
# if handle_all_green_paths variable is set then
|
155
|
+
# 1. routes that's app name is cf_app are found
|
156
|
+
# 2. paths are mapped to the green app
|
149
157
|
if [ -n "$handle_all_green_paths" ]; then
|
150
158
|
run-cmd cf routes | tail -n +4 | awk '($5==ENVIRON["cf_app"]) {print $3" -n "$2 " --path "substr($4,2) }'
|
151
159
|
cf routes | tail -n +4 | awk '($5==ENVIRON["cf_app"]) {print $3" -n "$2 " --path "substr($4,2) }' | xargs -n 5 cf map-route ${green}
|
152
160
|
fi
|
153
|
-
|
154
|
-
|
155
161
|
set +x
|
156
162
|
}
|
157
163
|
|
158
164
|
function remove-blue {
|
159
165
|
run-cmd cf delete ${blue} -f
|
160
166
|
run-cmd cf rename $green $blue
|
161
|
-
run-cmd cf
|
162
|
-
|
167
|
+
run-cmd cf routes | awk '($4==ENVIRON["green"]) {print $3" -n " $2 " -f"}' | xargs -n 4 cf delete-route
|
168
|
+
|
169
|
+
if [ -n "$handle_all_green_paths" ]; then
|
163
170
|
set -x
|
164
|
-
run-cmd cf routes | tail -n +4 | awk '($
|
165
|
-
cf routes | tail -n +4 | awk '($
|
171
|
+
run-cmd cf routes | tail -n +4 | awk '($5==ENVIRON["green"]) {print $3" -n "$2 " --path "substr($4,2)" -f"}' | xargs -n 6
|
172
|
+
cf routes | tail -n +4 | awk '($5==ENVIRON["green"]) {print $3" -n "$2 " --path "substr($4,2)" -f"}' | xargs -n 6 cf delete-route
|
166
173
|
set +x
|
167
174
|
fi
|
168
175
|
}
|
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.
|
4
|
+
version: '0.28'
|
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-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|