-
Notifications
You must be signed in to change notification settings - Fork 58
[김창우] sprint8 #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
youngxpepp
merged 30 commits into
codeit-bootcamp-spring:part3-김창우
from
qwertyuiop4m:part3-김창우-spirnt8
Apr 22, 2025
The head ref may contain hidden characters: "part3-\uAE40\uCC3D\uC6B0-spirnt8"
Merged
[김창우] sprint8 #391
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e11d41c
feat: application container
qwertyuiop4m c8e0dfd
feat: binaryContent 고도화
qwertyuiop4m d05a8e7
refactor: 멀티 스테이지
qwertyuiop4m a914ca6
feat: CI/CD
qwertyuiop4m dc6077a
refactor: 오타 수정
qwertyuiop4m e6885a4
refactor: 오타 수정
qwertyuiop4m 9502eed
refactor: 권한 설정
qwertyuiop4m cbaba5f
refactor: login 설정
qwertyuiop4m 97df812
feat: render
qwertyuiop4m 9fc8367
refactor: 파일 위치 변경
qwertyuiop4m e506c22
refactor: task definition 등록
qwertyuiop4m b2beb4c
feat: 수동 버튼 추가
qwertyuiop4m cc74aad
feat: port 설정
qwertyuiop4m df8e6ef
feat: port 설정
qwertyuiop4m ff1d5e5
feat: 태스크 설정
qwertyuiop4m 87ec38d
feat: 태스크 설정, port 수정
qwertyuiop4m 363cc0e
feat: 태스크
qwertyuiop4m 26461cc
feat: 포트 설정
qwertyuiop4m b45d3e8
refactor: 테스크 수정(프리티어)
qwertyuiop4m 6f31815
CI test
qwertyuiop4m 506b750
CI test
qwertyuiop4m d1f7b97
CI test
qwertyuiop4m 895b92c
CI test2
qwertyuiop4m b78a357
CI test
qwertyuiop4m 1382329
CI test
qwertyuiop4m fb37371
CI test
qwertyuiop4m 39a8f72
sprint8
qwertyuiop4m 3b05c95
sprint8
qwertyuiop4m 07fc674
sprint8
qwertyuiop4m 134fc8c
sprint8
qwertyuiop4m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or 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,16 @@ | ||
/build | ||
/.gradle | ||
|
||
.idea | ||
*.iml | ||
|
||
.git | ||
.gitignore | ||
|
||
.DS_Store | ||
*.log | ||
*.db | ||
.env | ||
|
||
!gradlew | ||
!gradlew.bat |
This file contains hidden or 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,5 @@ | ||
AWS_S3_ACCESS_KEY=test | ||
AWS_S3_SECRET_KEY=test | ||
AWS_S3_REGION=ap-northeast-2 | ||
AWS_S3_BUCKET=test-bucket | ||
AWS_S3_PRESIGNED_URL_EXPIRATION=600 |
This file contains hidden or 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,82 @@ | ||
name: CD - Deploy to ECS | ||
|
||
on: | ||
push: | ||
branches: | ||
- release | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
IMAGE_TAG: ${{ github.sha }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS credentials (for ECR) | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Login to Public ECR | ||
run: | | ||
aws ecr-public get-login-password --region us-east-1 \ | ||
| docker login --username AWS --password-stdin public.ecr.aws | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
docker build -t ${{ vars.ECR_REPOSITORY_URI }}:latest \ | ||
-t ${{ vars.ECR_REPOSITORY_URI }}:${{ env.IMAGE_TAG }} . | ||
docker push ${{ vars.ECR_REPOSITORY_URI }}:latest | ||
docker push ${{ vars.ECR_REPOSITORY_URI }}:${{ env.IMAGE_TAG }} | ||
|
||
- name: Configure AWS credentials (for ECS) | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
|
||
- name: Render ECS task definition | ||
id: render-task | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: ecs/task-definition.json | ||
container-name: discodeit-app | ||
image: ${{ vars.ECR_REPOSITORY_URI }}:${{ env.IMAGE_TAG }} | ||
|
||
- name: Register new ECS task definition | ||
id: register-task | ||
run: | | ||
TASK_DEF_ARN=$(aws ecs register-task-definition \ | ||
--cli-input-json file://${{ steps.render-task.outputs.task-definition }} \ | ||
--query 'taskDefinition.taskDefinitionArn' --output text) | ||
echo "TASK_DEF_ARN=$TASK_DEF_ARN" >> $GITHUB_ENV | ||
|
||
- name: Scale service to 0 (stop current task) | ||
run: | | ||
aws ecs update-service \ | ||
--cluster ${{ vars.ECS_CLUSTER }} \ | ||
--service ${{ vars.ECS_SERVICE }} \ | ||
--desired-count 0 | ||
sleep 30 | ||
|
||
- name: Deploy new ECS task definition with count 1 | ||
run: | | ||
aws ecs update-service \ | ||
--cluster ${{ vars.ECS_CLUSTER }} \ | ||
--service ${{ vars.ECS_SERVICE }} \ | ||
--task-definition ${{ env.TASK_DEF_ARN }} \ | ||
--desired-count 1 | ||
|
||
- name: Wait for ECS service to stabilize | ||
run: | | ||
aws ecs wait services-stable \ | ||
--cluster ${{ vars.ECS_CLUSTER }} \ | ||
--services ${{ vars.ECS_SERVICE }} |
This file contains hidden or 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,30 @@ | ||
name: CI-Test | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Grant execute permission to Gradle | ||
run: chmod +x gradlew | ||
|
||
- name: Build and Test with Gradle | ||
run: ./gradlew clean test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gitignore에 .idea가 있는데도 불구하고 제외가 안되나 보네요!
아래 글 보시겠어요?
https://coding-groot.tistory.com/59