-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48845a2
commit d383ac5
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
echo "> 현재 구동중인 Port 확인" | ||
|
||
PROFILE_BLUE=$(curl -s http://localhost:8081/api/profile) | ||
PROFILE_GREEN=$(curl -s http://localhost:8082/api/profile) | ||
|
||
# blue가 사용중이면 green이 쉬고 있고, 반대면 blue가 쉬고 있음 | ||
if [ $PROFILE_BLUE == blue ] | ||
then | ||
IDLE_PORT=8082 | ||
elif [ $PROFILE_GREEN == green ] | ||
then | ||
IDLE_PORT=8081 | ||
else | ||
echo "> 일치하는 Profile이 없습니다. Profile: $PROFILE_BLUE $PROFILE_GREEN" | ||
echo "> 8081을 할당합니다." | ||
IDLE_PORT=8081 | ||
fi | ||
|
||
echo "> 전환할 Port: $IDLE_PORT" | ||
echo "> Port 전환" | ||
echo "set \$service_url http://localhost:${IDLE_PORT};" |sudo tee /etc/nginx/conf.d/service-url.inc | ||
|
||
echo "> Nginx Reload" | ||
sudo service nginx reload |