forked from cloudfoundry-attic/cloudfoundry.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·51 lines (45 loc) · 1.12 KB
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# cf v6
sh build.sh
cf api https://api.run.pivotal.io
cf login -o cfcommunity -s cforg
curl_results=$(curl cforg1.cfapps.io)
if [[ $curl_results == *cforg1.cfapps.io* ]]
then
cf start cforg1
cf push cforg1
echo Does cforg1.cfapps.io look good? [y/n]
read
if [ "$REPLY" = "y" ]; then
echo Great! Moving on to mapping ...
else
echo Stopping cforg1, logging out and exiting this script...
cf stop cforg1
cf logout
exit
fi
cf map-route cforg1 cloudfoundry.org -n www
cf unmap-route cforg2 cloudfoundry.org -n www
cf map-route cforg1 cloudfoundry.org
cf unmap-route cforg2 cloudfoundry.org
cf stop cforg2
else
cf start cforg2
cf push cforg2
echo Does cforg2.cfapps.io look good? [y/n]
read
if [ "$REPLY" = "y" ]; then
echo Great! Moving on to mapping ...
else
echo Stopping cforg2, logging out and exiting this script...
cf stop cforg2
cf logout
exit
fi
cf map-route cforg2 cloudfoundry.org -n www
cf unmap-route cforg1 cloudfoundry.org -n www
cf map-route cforg2 cloudfoundry.org
cf unmap-route cforg1 cloudfoundry.org
cf stop cforg1
fi
cf logout