Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into qa
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/CI-Sonar.yml
  • Loading branch information
dldmsql committed May 7, 2024
2 parents 22f17e8 + ea207d1 commit d483cc1
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
permissions: write-all #테스트 결과 작성을 위해 쓰기권한 추가

env: # deploy env
S3_BUCKET_NAME: duaily-deploy
PROJECT_NAME: duaily-server
S3_BUCKET_NAME: jmhouse-prod-deploy
PROJECT_NAME: backend


jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/CI-Sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- opened
- synchronize
- reopened
workflow_dispatch:

permissions:
checks: write
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@
- Jasypt

### E-R 다이어그램
![주말내집 ERD-6](https://github.com/ODOICHON/server/assets/61505572/24511404-8fd0-49fe-9104-6245d7b24fec)
![주말내집 ERD-7](https://github.com/ODOICHON/server/assets/61505572/bba582cd-bf66-4c36-8158-f6ff9521ff83)


### REST DOCS 기반 API 명세서
**전체 문서**
- [Index](https://odoichon.github.io/server/src/main/resources/static/docs/index.html)

**주말내집 서비스**
- [사용자 API 명세서](https://odoichon.github.io/server/src/main/resources/static/docs/user.html)
- [게시글 API 명세서](https://odoichon.github.io/server/src/main/resources/static/docs/board.html)
Expand Down
12 changes: 6 additions & 6 deletions appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ version: 0.0
os: linux
files:
- source: / # 인스턴스에 복사할 S3 파일의 경로, / 로 설정하면S3_BUCKET_NAME/PROJECT_NAME/GITHUB_SHA.zip
destination: /home/ubuntu/duaily-server/ # 프로젝트 이름 # S3에서 가져온 파일을 저장할 위치
destination: /home/ec2-user/duaily-server/ # 프로젝트 이름 # S3에서 가져온 파일을 저장할 위치
overwrite: yes # 덮어쓰기 허용


permissions:
- object: /
pattern: "**"
owner: ubuntu
group: ubuntu
owner: ec2-user
group: ec2-user

# hook
hooks:
ApplicationStart:
- location: scripts/run_new_was.sh
timeout: 60
runas: ubuntu
runas: ec2-user
- location: scripts/health_check.sh
timeout: 60
runas: ubuntu
runas: ec2-user
- location: scripts/switch.sh
timeout: 60
runas: ubuntu
runas: ec2-user
15 changes: 0 additions & 15 deletions script.sql

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/health-check.sh

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/health_check.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Crawl current connected port of WAS
CURRENT_PORT=$(cat /home/ubuntu/service_url.inc | grep -Po '[0-9]+' | tail -1)
CURRENT_PORT=$(cat /home/ec2-user/service_url.inc | grep -Po '[0-9]+' | tail -1)
TARGET_PORT=0

# Toggle port Number
Expand All @@ -15,12 +15,12 @@ else
fi


echo "> Start health check of WAS at 'http://13.209.202.74:${TARGET_PORT}' ..."
echo "> Start health check of WAS at 'http://52.78.62.13:${TARGET_PORT}' ..."

for RETRY_COUNT in 1 2 3 4 5 6 7 8 9 10
do
echo "> #${RETRY_COUNT} trying..."
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://13.209.202.74:${TARGET_PORT}/api)
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://52.78.62.13:${TARGET_PORT}/api)

if [ ${RESPONSE_CODE} -eq 200 ]; then
echo "> New WAS successfully running"
Expand Down
4 changes: 2 additions & 2 deletions scripts/run_new_was.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

CURRENT_PORT=$(cat /home/ubuntu/service_url.inc | grep -Po '[0-9]+' | tail -1)
CURRENT_PORT=$(cat /home/ec2-user/service_url.inc | grep -Po '[0-9]+' | tail -1)
TARGET_PORT=0

echo "> Current port of running WAS is ${CURRENT_PORT}."
Expand All @@ -20,6 +20,6 @@ if [ ! -z ${TARGET_PID} ]; then
sudo kill ${TARGET_PID}
fi

nohup java -jar -Dserver.port=${TARGET_PORT} /home/ubuntu/duaily-server/build/libs/* > /home/ubuntu/nohup.out 2>&1 --spring.profiles.active=prod &
nohup java -jar -Dserver.port=${TARGET_PORT} /home/ec2-user/duaily-server/build/libs/* > /home/ec2-user/nohup.out 2>&1 --spring.profiles.active=prod &
echo "> Now new WAS runs at ${TARGET_PORT}."
exit 0
6 changes: 3 additions & 3 deletions scripts/switch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Crawl current connected port of WAS
CURRENT_PORT=$(cat /home/ubuntu/service_url.inc | grep -Po '[0-9]+' | tail -1)
CURRENT_PORT=$(cat /home/ec2-user/service_url.inc | grep -Po '[0-9]+' | tail -1)
TARGET_PORT=0

echo "> Nginx currently proxies to ${CURRENT_PORT}."
Expand All @@ -17,8 +17,8 @@ else
fi

# Change proxying port into target port
echo "set \$service_url http://13.209.202.74:${TARGET_PORT};" | tee /home/ubuntu/service_url.inc
echo "set \$service_admin_url http://13.209.202.74:${TARGET_PORT}/admin;" | tee /home/ubuntu/service_admin_url.inc
echo "set \$service_url http://52.78.62.13:${TARGET_PORT};" | sudo tee /home/ec2-user/service_url.inc
echo "set \$service_admin_url http://52.78.62.13:${TARGET_PORT}/admin;" | sudo tee /home/ec2-user/service_admin_url.inc

echo "> Now Nginx proxies to ${TARGET_PORT}."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class WebConfig (
"https://dev.duaily.net",
"https://dev.jmhouse.org",
"https://jmhouse.org",
"https://jmhouse.kr",
"https://dev.jmhouse.kr"

)
.allowedMethods(
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring:
jpa:
database: mysql
hibernate:
ddl-auto: update
ddl-auto: none
properties:
hibernate:
default_batch_fetch_size: 100
Expand All @@ -20,7 +20,7 @@ spring:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

datasource:
url: ENC(reLiSYw8bj9dC732X/R0XRVWUQpC5oA6gtuIcaEOcDafwECc2FU3j/ASSgBhZRn3E5ofn53Z4MqrPpvHTCbe4+BPtFoCdKz/NeBCA1m3oIbdziyYUMTpz3PslJetYQrs2Y5+lFdObHJ40Fs/ZJ8BmavUjnPdfbFqBWPkJ/JsamI=)
url: ENC(baCQGMmnNRLXhSbDYpdJc0qa5vVX6ewlntiDdoBM6ek4J/enhuk/JXnxKdt8/Di0SymyJQqPV+ecdDe9wBQj54J5iKjqnadNFoUqz4SKczJUKwjZYsagh93BmQ9YluP1WIgXJpER0DoeTTRChA3V7hnrvQzjptB48fRbun4bayA=)
username: ENC(xvhrw7GfC3KXyEKIbbXRLA==)
password: ENC(vJiB+8VMlNd15HOYQaBDZKNBBO5rHvrY)
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spring:
jpa:
database: mysql
hibernate:
ddl-auto: update
ddl-auto: none
properties:
hibernate:
default_batch_fetch_size: 100
Expand All @@ -19,7 +19,7 @@ spring:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

datasource:
url: ENC(jHn8mCpeceVJdoywHaYNsz3LN9K1FmTg8G6UlCUJ8tm/ynVfbRKQKwE1ULOjLAN6/A0xuZed4cIBMsgkthdDYOsb+u9LZHr5eCM6aJdlXRBZGjz8+Usb6rw8XAeSY3vSwshDyXvrPkH7tksKwDAs9TbFUxlmt1ZyzUef9RwH1u0=)
url: ENC(8rCqUArmgNpUD2dzAHsyxB8kyDMEHfvWzmuVodOv2eirtY7fr9eFOtfZ/OCIVbI+rCRG4KaXMUB+RGwE2QBOpuhwHERCS7agrqarKSRfSLs9kc44uC96X1kjyDZQ6gOciR0YD0wnyTDkocVWGakKKEEgpJ8eD93qAA88RQ4VUIk=)
username: ENC(xvhrw7GfC3KXyEKIbbXRLA==)
password: ENC(vJiB+8VMlNd15HOYQaBDZKNBBO5rHvrY)
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down

0 comments on commit d483cc1

Please sign in to comment.