-
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.
Merge pull request #292 from depromeet/develop
refactor: layer-admin, layer-batch 코드 layer-api로 이관
- Loading branch information
Showing
42 changed files
with
910 additions
and
368 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
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
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
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
FROM openjdk:17 | ||
|
||
ARG JAR_FILE=./build/libs/*.jar | ||
ARG SPRING_PROFILE | ||
|
||
COPY ${JAR_FILE} layer-server.jar | ||
ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=dev" ,"-jar" ,"layer-server.jar"] | ||
|
||
ENV SPRING_PROFILE=${SPRING_PROFILE} | ||
|
||
ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=${SPRING_PROFILE}" ,"-jar" ,"layer-server.jar"] |
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
#!/bin/bash | ||
|
||
IS_GREEN=$(sudo docker ps | grep layer-api-green) # 현재 실행중인 App이 blue인지 확인합니다. | ||
DEFAULT_CONF="/etc/nginx/nginx.conf" | ||
|
||
|
||
if [ -z $IS_GREEN ];then # blue라면 | ||
|
||
echo "### BLUE => GREEN ###" | ||
|
||
echo "1. get green image" | ||
cd ./layer-api/infra/production | ||
|
||
echo "1.1. pull latest green image" | ||
sudo docker-compose -f docker-compose-green.yaml pull | ||
|
||
echo "2. green container up" | ||
sudo docker-compose -f docker-compose-green.yaml up -d | ||
|
||
while [ 1 = 1 ]; do | ||
echo "3. green health check..." | ||
sudo sleep 3 | ||
|
||
REQUEST=$(sudo curl http://127.0.0.1:8080/actuator/health) # green으로 request | ||
if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 | ||
echo "health check success" | ||
break ; | ||
fi | ||
done; | ||
|
||
echo "4. reload nginx" | ||
sudo cp ./nginx.green.conf /etc/nginx/nginx.conf | ||
sudo nginx -s reload | ||
|
||
echo "5. blue container down" | ||
sudo docker-compose -f docker-compose-blue.yaml rm -s -f layer-api-blue | ||
else | ||
echo "### GREEN => BLUE ###" | ||
echo "1. get blue image" | ||
cd ./layer-api/infra/production | ||
|
||
echo "1.1. pull latest blue image" | ||
sudo docker-compose -f docker-compose-blue.yaml pull | ||
|
||
echo "2. blue container up" | ||
sudo docker-compose -f docker-compose-blue.yaml up -d | ||
|
||
|
||
while [ 1 = 1 ]; do | ||
echo "3. blue health check..." | ||
sleep 3 | ||
REQUEST=$(curl http://127.0.0.1:8081/actuator/health) # blue로 request | ||
|
||
if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 | ||
echo "health check success" | ||
break ; | ||
fi | ||
done; | ||
|
||
echo "4. reload nginx" | ||
sudo cp ./nginx.blue.conf /etc/nginx/nginx.conf | ||
sudo nginx -s reload | ||
|
||
echo "5. green container down" | ||
sudo docker-compose -f docker-compose-green.yaml rm -s -f layer-api-green | ||
fi |
Oops, something went wrong.