-
Notifications
You must be signed in to change notification settings - Fork 24
[이채원] sprint8 #226
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
Open
Chaewon3Lee
wants to merge
49
commits into
codeit-bootcamp-spring:이채원
Choose a base branch
from
Chaewon3Lee:main
base: 이채원
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[이채원] sprint8 #226
Conversation
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
feat: 리소스 파일 추가
add: CI workflow 추가
chore: codecov action 버전 수정
chore: gradlew 실행 권한 수정
chore: 테스트 환경 개선
chore: S3BinaryContentStorageTest 환경 변수 수정
chore: S3BinaryContentStorageTest 환경 변수 수정
ci: test.yml 에 test 환경변수 코드 추가
feat: .env 파일을 통한 환경 변수 관리 설정 추가
ci: Gradle 빌드 단계 제거 및 JDK 17 버전 수정
ci: gradle 실행 권한 부여
ci: JDK 설정을 위해 setup-java@v4로 업데이트
fix: AWSS3TEST 비활성화
ci: aws 테스트 스크립트 추가
ci: aws 커넥션 테스트 스크립트 수정
ci: aws 커넥션 테스트 스크립트 리전 수정
[PR] 자동 배포 구현
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
요구사항
기본
애플리케이션 컨테이너화
Dockerfile 작성
이미지 빌드 및 실행 테스트
Docker Compose 구성
--build
플래그를 사용하여 서비스 시작 전에 이미지를 빌드하도록 합니다.BinaryContentStorage 고도화 (AWS S3) 체크리스트
AWS S3 버킷 구성
AWS S3 접근을 위한 IAM 구성
```env
AWS_S3_ACCESS_KEY=엑세스_키
AWS_S3_SECRET_KEY=시크릿_키
AWS_S3_REGION=ap-northeast-2
AWS_S3_BUCKET=버킷_이름
```
AWS S3 테스트
```groovy
implementation 'software.amazon.awssdk:s3:2.31.7'
```
AWS S3를 활용한 BinaryContentStorage 고도화
```yaml
discodeit:
storage:
type: ${STORAGE_TYPE:local} # local | s3 (기본값: local)
local:
root-path: ${STORAGE_LOCAL_ROOT_PATH:.discodeit/storage}
s3:
access-key: ${AWS_S3_ACCESS_KEY}
secret-key: ${AWS_S3_SECRET_KEY}
region: ${AWS_S3_REGION}
bucket: ${AWS_S3_BUCKET}
presigned-url-expiration: ${AWS_S3_PRESIGNED_URL_EXPIRATION:600} # 기본값 10분
```
AWS를 활용한 배포 (AWS RDS, ECR, ECS) 체크리스트
AWS RDS 구성
과금이 발생할 수 있으니 다음 항목은 한번 더 확인해주세요.
SSH 터널링을 통해 개발 환경에서 접근할 수 있도록 EC2를 구성하세요.
EC2 인스턴스를 생성하세요.
보안 그룹에서 인바운드 규칙을 편집하세요.
DataGrip을 통해 연결 후 데이터베이스와 사용자, 테이블을 초기화하세요.
데이터 소스 추가 시 SSH/SSL > Use SSH tunnel 설정을 활성화하세요. 이때 이전에 다운로드한 .pem 파일을 활용하세요.
연결이 성공하면 데이터베이스와 사용자, 테이블을 초기화하세요.
AWS ECR 구성
엑세스 키
시크릿 키
region: ap-northeast-2
output format: json
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/...
멀티플랫폼 이미지를 빌드하고 push 하세요.
AWS 콘솔에서 푸시된 이미지 확인
AWS ECS 구성
태스크의 EC2 보안 그룹의 인바운드 규칙을 설정하여 어디서든 접근할 수 있도록 하세요.
EC2 보안 그룹에서 인바운드 규칙을 편집하세요.
규칙 유형으로 HTTP를 선택하세요.
Anywhere-IPv4를 선택하여 모든 IP를 허용하세요.
태스크 실행이 완료되면 해당 EC2의 퍼블릭 IP에 접속해보세요.
심화
이미지 최적화 및 GitHub Actions CI/CD 파이프라인 구축 체크리스트
이미지 최적화하기
GitHub Actions를 활용한 CI/CD 파이프라인 구축
CI (지속적 통합)
.github/workflows/test.yml
파일을 생성하세요.CD (지속적 배포)
CD 워크플로우를 설정하세요.
.github/workflows/deploy.yml
파일을 생성하세요.release 브랜치에 코드가 푸시되면 실행되도록 설정하세요.
AWS 정보 설정
GitHub 레포지토리 설정을 통해 시크릿을 추가하세요.
GitHub 레포지토리 설정을 통해 변수를 추가하세요.
Docker 이미지 빌드 및 푸시
latest
와 GitHub 커밋 해시를 사용하도록 설정하세요.ECS 서비스 업데이트
aws ecs update-service --desired-count
)주요 변경사항
. 원활한 실습 진행을 위해 Spring Boot Admin 관련 코드는 삭제되었습니다.
세부 사항
admin 모듈
IntelliJ Gradle 툴 윈도우에서도 삭제해주세요.
yfdejqkdz-image.png
spring boot admin 의존성 삭제
build.gradle
...
implementation 'de.codecentric:spring-boot-admin-starter-client:3.4.5'
...
2. 프로젝트 버전이 변경되었습니다. v1.2-M8
세부 사항
build.gradle
...
version = '0.0.1-SNAPSHOT'
version = '1.2-M8'
...
1.2: api-doc 버전을 따릅니다.
M8: 미션 8을 의미합니다.
스크린샷
리뷰를 위해 PR에 포함해야 할 정보 체크리스트
원활한 리뷰를 위해 PR에 다음과 같은 정보를 포함해주세요.
.env
파일 (AWS 키는 제외)제출용.txt
RDS
rds콘솔캡쳐.pdf
ECR
ECS
http://3.38.153.169/
VPC
IAM
멘토에게