File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 66
66
sleep 10
67
67
done
68
68
69
- ls -al
70
- pwd
71
- chmod +x ./switch.sh
72
-
73
69
echo " > 스위칭"
74
70
sleep 10
75
- ./switch.sh
71
+ echo " > 현재 구동중인 Port 확인"
72
+ CURRENT_PROFILE=$( curl -s http://localhost/profile)
73
+
74
+ if [ $CURRENT_PROFILE == deploy-one ]
75
+ then
76
+ IDLE_PORT=8082
77
+ elif [ $CURRENT_PROFILE == deploy-two ]
78
+ then
79
+ IDLE_PORT=8081
80
+ else
81
+ echo " > 일치하는 Profile이 없습니다. Profile: $CURRENT_PROFILE "
82
+ echo " > 8081을 할당합니다."
83
+ IDLE_PORT=8081
84
+ fi
85
+
86
+ echo " > 전환할 Port: $IDLE_PORT "
87
+ echo " > Port 전환"
88
+ echo " set \$ service_url http://127.0.0.1:${IDLE_PORT} ;" | sudo tee /etc/nginx/conf.d/service-url.inc
89
+
90
+ PROXY_PORT=$( curl -s http://localhost/profile)
91
+ echo " > Nginx Current Proxy Port: $PROXY_PORT "
92
+
93
+ echo " > Nginx Reload"
94
+ sudo service nginx reload
You can’t perform that action at this time.
0 commit comments