Skip to content
Merged

Dev #140

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
- "backend/settings.gradle.kts"
- "backend/Dockerfile"
branches:
- dev
- main
workflow_dispatch:

jobs:
makeTagAndRelease:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,7 +74,7 @@ jobs:
ghcr.io/${{ env.OWNER_LC }}/${{ env.DOCKER_IMAGE_NAME }}:${{ needs.makeTagAndRelease.outputs.tag_name }},
ghcr.io/${{ env.OWNER_LC }}/${{ env.DOCKER_IMAGE_NAME }}:latest

deploy:
deploy:
runs-on: ubuntu-latest
needs: [buildImageAndPush]
env:
Expand All @@ -86,10 +88,9 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: ์ธ์Šคํ„ด์Šค ID ๊ฐ€์ ธ์˜ค๊ธฐ (Target: dev-ec2-yogiss)
- name: "์ธ์Šคํ„ด์Šค ID ๊ฐ€์ ธ์˜ค๊ธฐ (Target: dev-ec2-yogiss)"
id: get_instance_id
run: |
# Values ๋ถ€๋ถ„์„ dev-ec2-yogiss๋กœ ์ˆ˜์ •ํ•˜์—ฌ ํ†ตํ•ฉ ์„œ๋ฒ„๋กœ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=dev-ec2-yogiss" "Name=instance-state-name,Values=running" --query "Reservations[].Instances[].InstanceId" --output text)
echo "INSTANCE_ID=$INSTANCE_ID" >> $GITHUB_ENV
echo "์ฐพ์€ ์ธ์Šคํ„ด์Šค ID: $INSTANCE_ID"
Expand Down Expand Up @@ -120,7 +121,6 @@ jobs:
docker pull ghcr.io/${{ env.OWNER_LC }}/${{ env.DOCKER_IMAGE_NAME }}:latest

echo "=== ๊ธฐ์กด Anidoc ์ปจํ…Œ์ด๋„ˆ ์ •๋ฆฌ ==="
# app1 ๋Œ€์‹  anidoc-app ์ด๋ฆ„์„ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๊ธฐ์“ฐ(app1)์™€ ์ถฉ๋Œ์„ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค.
if docker stop anidoc-app 2>/dev/null; then
echo "โœ… ๊ธฐ์กด anidoc-app ์ค‘์ง€๋จ"
fi
Expand All @@ -132,16 +132,12 @@ jobs:
docker network ls | grep common || docker network create common

echo "=== ์ƒˆ ์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰ (Port: 8082) ==="
# ํฌํŠธ๋ฅผ 8082๋กœ ํ• ๋‹นํ•˜์—ฌ ์—ฌ๊ธฐ์“ฐ(8080/8081)์™€ ๋…๋ฆฝ์ ์œผ๋กœ ์šด์˜ํ•ฉ๋‹ˆ๋‹ค.
if docker run -d --network common --name anidoc-app -p 8082:8080 ghcr.io/${{ env.OWNER_LC }}/${{ env.DOCKER_IMAGE_NAME }}:latest; then
echo "โœ… anidoc-app ์‹คํ–‰ ์„ฑ๊ณต"

echo "=== ๋ฐฐํฌ ์ƒํƒœ ํ™•์ธ ==="
docker ps -a | grep anidoc-app

echo "=== ์‹คํ–‰ ๋กœ๊ทธ ํ™•์ธ (์ตœ๊ทผ 50์ค„) ==="
docker logs --tail 50 anidoc-app

echo "=== ํฌํŠธ ๋ฆฌ์Šค๋‹ ํ™•์ธ ==="
netstat -tlnp | grep 8082 || echo "โš ๏ธ 8082 ํฌํŠธ ํ™•์ธ ํ•„์š”"
else
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ custom:

spring:
datasource:
url: jdbc:mysql://mysql_1:3306/anidocdb?serverTimezone=Asia/Seoul
url: jdbc:mysql://mysql-anidoc:3306/anidocdb?serverTimezone=Asia/Seoul
username: petner
password: petner
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down
Loading