Skip to content

Commit

Permalink
feat: 모니터링 대시보드를 위한 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingyum-Kim committed Oct 21, 2024
1 parent 9f15539 commit a807e57
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/be-rolling-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Rolling Deployment

on:
push:
branches:
- chore/#695

jobs:
deploy-prod1:
name: Deploy to Prod1 Instance
runs-on: runner-prod1

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run Prod1 instance deploy script
run: |
cd ~/deploy && ./deploy.sh
check-prod1:
name: Check Prod1 Instance
runs-on: runner-prod1
needs: deploy-prod1

steps:
- name: Wait for Prod1 instance to be ready
run: sleep 30

- name: Health check for Prod1 instance
run: |
RESPONSE=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/health)
if [ $RESPONSE -ne 200 ]; then
echo "Prod1 instance deployment failed."
exit 1
fi
echo "Prod1 instance is healthy."
deploy-prod2:
name: Deploy to Prod2 Instance
runs-on: runner-prod2
needs: check-prod1

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run Prod2 instance deploy script
run: |
cd ~/deploy && ./deploy.sh
check-prod2:
name: Check Prod2 Instance
runs-on: runner-prod2
needs: deploy-prod2

steps:
- name: Wait for Prod2 instance to be ready
run: sleep 30

- name: Health check for Prod2 instance
run: |
RESPONSE=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/health)
if [ $RESPONSE -ne 200 ]; then
echo "Prod2 instance deployment failed."
exit 1
fi
echo "Prod2 instance is healthy."
4 changes: 4 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ dependencies {

// S3
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.773'

// monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
}

tasks.named('test') {
Expand Down
9 changes: 9 additions & 0 deletions backend/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ aws:

url:
base: http://localhost:8081

management:
endpoints:
web:
exposure:
include: prometheus
endpoint:
health:
show-details: always

0 comments on commit a807e57

Please sign in to comment.