Skip to content

Commit 6b1910e

Browse files
authored
Merge pull request #398 from k01zero/part2-김경린
[김경린] sprint8
2 parents 15f181c + 46fb343 commit 6b1910e

File tree

79 files changed

+5385
-2010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5385
-2010
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-image
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
updated-image
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-image
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
테스트 첨부 파일 내용

.dockerignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Gradle ###
2+
.gradle/
3+
build/
4+
5+
### IntelliJ IDEA ###
6+
.idea/
7+
*.iml
8+
*.iws
9+
10+
### OS 자동 생성 파일 ###
11+
.DS_Store
12+
Thumbs.db
13+
14+
### 로그 ###
15+
*.log

.github/img.png

-59.5 KB
Binary file not shown.

.github/img_1.png

-76.9 KB
Binary file not shown.

.github/img_2.png

-41.4 KB
Binary file not shown.

.github/img_3.png

-79 KB
Binary file not shown.

.github/img_4.png

-138 KB
Binary file not shown.

.github/pull-request-template.md

-198
This file was deleted.

.github/workflows/deploy.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Deploy to ECS
2+
3+
on:
4+
push:
5+
branches:
6+
- part2-김경린
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Configure AWS credentials for ECR
17+
uses: aws-actions/configure-aws-credentials@v2
18+
with:
19+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
20+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
21+
aws-region: us-east-1
22+
23+
- name: Login to Amazon ECR Public
24+
run: |
25+
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/k5f2z7e1
26+
27+
- name: Build Docker Image
28+
run: |
29+
docker build -t ${{ vars.ECR_REPOSITORY_URI }}:latest .
30+
docker tag ${{ vars.ECR_REPOSITORY_URI }}:latest ${{ vars.ECR_REPOSITORY_URI }}:${{ github.sha }}
31+
32+
- name: Push Docker image to ECR
33+
run: |
34+
docker push ${{ vars.ECR_REPOSITORY_URI }}:latest
35+
docker push ${{ vars.ECR_REPOSITORY_URI }}:${{ github.sha }}
36+
37+
- name: Configure AWS credentials for ECS
38+
uses: aws-actions/configure-aws-credentials@v2
39+
with:
40+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
41+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
42+
aws-region: ${{ vars.AWS_REGION }}
43+
44+
- name: Render ECS Task Definition
45+
uses: aws-actions/amazon-ecs-render-task-definition@v1
46+
with:
47+
task-definition: ecs/task-definition.json
48+
container-name: discodeit-app
49+
image: ${{ vars.ECR_REPOSITORY_URI }}:latest
50+
51+
# aws ecs update-service --desired-count 옵션을 활용하세요.
52+
- name: Stop current ECS service
53+
run: |
54+
aws ecs update-service \
55+
--cluster ${{ vars.ECS_CLUSTER }} \
56+
--service ${{ vars.ECS_SERVICE }} \
57+
--desired-count 0 \
58+
--region ${{ vars.AWS_REGION }}
59+
60+
- name: Deploy updated Task Definition to ECS
61+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
62+
with:
63+
task-definition: ecs/task-definition.json
64+
cluster: ${{ vars.ECS_CLUSTER }}
65+
service: ${{ vars.ECS_SERVICE }}
66+
wait-for-service-stability: true # 배포 안정화 확인 (헬스체크 통과 시까지 대기)

.github/workflows/test.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run Tests
2+
3+
on:
4+
push: # 테스트, 일시적으로 push 로 변경
5+
branches:
6+
- part2-김경린
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '17'
20+
distribution: temurin
21+
22+
- name: Cache Gradle packages
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
~/ .gradle/caches
27+
~/ .gradle/wrapper
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
31+
32+
- name: Grant execute permission for Gradle wrapper
33+
run: chmod +x gradlew
34+
35+
- name: Run tests
36+
run: ./gradlew test
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ bin/
4141
### Mac OS ###
4242
.DS_Store
4343

44+
### 환경변수 ###
45+
.env
46+
forPR.env
47+
discodeit.env
4448

4549
...
4650
.idea

0 commit comments

Comments
 (0)