Skip to content

Commit

Permalink
Update switch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho authored Apr 18, 2024
1 parent ba36570 commit a5b68af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/switch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
echo "> 현재 구동중인 Port 확인"

PROFILE_BLUE=$(curl -s http://localhost:8081/api/profile)
PROFILE_GREEN=$(curl -s http://localhost:8082/api/profile)
PROFILE_BLUE=$(curl -s http://127.0.0.1:8081/api/profile)
PROFILE_GREEN=$(curl -s http://127.0.0.1:8082/api/profile)

# blue가 사용중이면 green이 쉬고 있고, 반대면 blue가 쉬고 있음
if [ $PROFILE_BLUE == green ]
Expand All @@ -18,7 +18,7 @@ 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 "set \$service_url http://127.0.0.1:${IDLE_PORT};" |sudo tee /etc/nginx/conf.d/service-url.inc

echo "> Nginx Reload"
sudo service nginx reload

0 comments on commit a5b68af

Please sign in to comment.