HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
♥️
2기 최종 프로젝트 팀별 공간
/
😋
[팀 11] 테이스티
/
ℹ️
프로젝트 위키
/
🎓
프로젝트 컨벤션, 셋팅
🎓

프로젝트 컨벤션, 셋팅

 
  • CheckStyle 설정
  • Merge Rule
  • application.yml 설정파일
  • GitHub Actions CI
  • DTO
 

 

CheckStyle

인텔리제이 코딩 컨벤션 설정
practices, and methods for each aspect of a program written in that language.Coding conventionsare a set of guidelines for a specific programming languagethat recommend programming style https://en.wikipedia.org/wiki/Coding_conventions 출처 : 특정 프로그래밍 언어에 대한 프로그래밍 스타일, 관행 및 방법을 권장하는 일련의 지침이다.
인텔리제이 코딩 컨벤션 설정
https://055055.tistory.com/97
인텔리제이 코딩 컨벤션 설정
google-checkstyle-rules.xml
intellij-java-google-style.xml

build.gradle에 다음을 추가

plugins { id 'checkstyle' } checkstyle { maxWarnings = 0 // 규칙이 어긋나는 코드가 하나라도 있을 경우 빌드 fail을 내고 싶다면 이 선언을 추가한다. configFile = file("${rootDir}/config/checkstyle/google-checkstyle-rules.xml") toolVersion = "10.3" // checkstyle 버전 10.3 이상 선언 }
notion image
PR 보내기 전 Gradle → other → CheckStyleMain 실행하여 어떤 파일에서 어떤 컨벤션을 어겼는지 확인 가능

Merge Rule

이슈 번호 % 4
 
0 : 최지훈(Hoony), 김지웅(Luka)
1 : 정해민(Jaden), 최현웅(Jerry)
2 : 최현웅(Jerry), 김지웅(Luka)
3 : 최지훈(Hoony), 정해민(Jaden)
 
각 리뷰어 지정 이후 approve 2개 → 마지막 리뷰어가 머지
notion image
PR 날린 직후 02-프로젝트-11-be 채널에 리뷰어 멘션. PR 링크는 스레드 댓글로!
 

application.yml

 

GitHub Actions

name: Java CI with Gradle env: S3_BUCKET_NAME: masiottae-bucket CODE_DEPLOY_APPLICATION_NAME: masiottae-application CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: masiottae-deploy-group on: push: branches: [ "main", "develop" ] pull_request: branches: [ "main", "develop" ] permissions: contents: read jobs: build: runs-on: ubuntu-latest steps: # 액션이 실행되는 저장소의 코드를 클론하고 체크아웃한다. - name: Checkout uses: actions/checkout@v3 - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 - name: Grant execute permission for gradlew run: chmod +x ./gradlew shell: bash - name: Build with Gradle run: ./gradlew clean build shell: bash # 빌드 결과를 압축(GITHUB_SHA: 커밋ID) - name: Make zip file run: zip -r ./$GITHUB_SHA.zip . shell: bash # AWS 접근에 필요한 권한을 얻어온다. - name: Configure AWS credentials uses: aws-action/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - name: Upload to S3 run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip - name: Code Deploy run: | aws deploy create-deployment \ --application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME}} \ --deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \ --file-exists-behavior OVERWRITE \ --deployment-config-name CodeDeployDefault.AllAtOnce \ --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$GITHUB_SHA.zip \

DTO → Entity명 + CRUD + Request or Response

// Request DTO 예시 @Getter public class MenuCreateRequest { @Size(min = 1, max = 10, message = "메뉴명은 1자이상 10자이하여야 합니다.") private final String name; @JsonCreator public MenuCreateRequest (@JsonProperty String name) { this.name = name; } }
// Response DTO 예시 @Getter @AllArgsConstructor public class CategoryCreateResponse { private Long id; private String name; private LocalDateTime createdAt; }
public class EntityConverter { public Entity toEntity() ... public DTO toDTO() ... }

AWS 실행

// ec2 실행 ssh -i "devcourse-masiottae.pem" ubuntu@ec2-13-125-177-126.ap-northeast-2.compute.amazonaws.com // 서버 실행 $ java -jar -Dspring.profiles.active=prod ./build/libs/masiottae-0.0.1-SNAPSHOT.jar

RDS접속방법

[AWS] RDS 인스턴스에 접속하기
RDS 인스턴스에 접속하는 방법은 두가지가 있다. 1. 로컬PC에서 접속 (public access 허용했을시에만 가능) 2. EC2로 접속 1. 생성한 데이터베이스의 보안그룹 수정 생성한 데이터베이스를 클릭해서 연결&보안 탭을 확인한다. (database port는 mysql이라 3306) 인바운드 : 데이터베이스 서버입장에서 안으로 들어오는것 아웃바운드 : 데이터베이스 서버입장에서 응답하는것 지금은 보안그룹의 인바운드를 수정할것이다. 상단의 보안그룹 클릭! 2.
[AWS] RDS 인스턴스에 접속하기
https://doing7.tistory.com/33
[AWS] RDS 인스턴스에 접속하기
 
RDS ID : admin
RDS Password : masiottae
 

CI/CD

notion image

Development Environment

notion image