diff --git a/.github/workflows/dev-cd.yml b/.github/workflows/dev-cd.yml deleted file mode 100644 index cd1ceb2..0000000 --- a/.github/workflows/dev-cd.yml +++ /dev/null @@ -1,98 +0,0 @@ -# 워크플로우의 이름 지정 -name: RUNNECT-DEV-CD - -# 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정 -on: - push: - branches: [ dev ] # main branch로 push 될 때 실행됩니다. - -env: - S3_BUCKET_NAME: runnect-dev-bucket - -jobs: - build: - name: Code deployment - - # 실행 환경 - runs-on: ubuntu-latest - - steps: - - # 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 - - name: checkout - uses: actions/checkout@v3 - - # 2) JDK 11버전 설치, 다른 JDK 버전을 사용하다면 수정 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: 'gradle' - - # 3) 환경변수 파일 생성 - - name: make application.properties 파일 생성 - run: | - ## create application.yml - mkdir ./src/main/resources - cd ./src/main/resources - - # application.yml 파일 생성 - touch ./application.yml - - # GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 - echo "${{ secrets.RUNNECT_DEV_APPLICATION }}" >> ./application.yml - - # application.yml 파일 확인 - cat ./application.yml - shell: bash - - # 이 워크플로우는 gradle build - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Build with Gradle # 실제 application build 테스트 제외 - run: ./gradlew build -x test - - # 디렉토리 생성 - - name: Make Directory - run: mkdir -p deploy - - # Jar 파일 복사 - - name: Copy Jar - run: cp ./build/libs/*.jar ./deploy - - # appspec.yml 파일 복사 - - name: Copy appspec.yml - run: cp appspec.yml ./deploy - - # script files 복사 - - name: Copy script - run: cp ./scripts/*.sh ./deploy - - - name: Make zip file - run: zip -r ./runnect_dev_server.zip ./deploy - shell: bash - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_KEY }} - aws-secret-access-key: ${{ secrets.AWS_DEV_SECRET_KEY }} - aws-region: ap-northeast-2 - - - name: Upload to S3 - run: aws s3 cp --region ap-northeast-2 ./runnect_dev_server.zip s3://$S3_BUCKET_NAME/ - - # Deploy - - name: Deploy - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DEV_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEV_SECRET_KEY }} - run: - aws deploy create-deployment - --application-name runnect-dev-codedeploy - --deployment-group-name runnect-dev-codedeploy-group - --file-exists-behavior OVERWRITE - --s3-location bucket=runnect-dev-bucket,bundleType=zip,key=runnect_dev_server.zip - --region ap-northeast-2 diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml deleted file mode 100644 index eedef2a..0000000 --- a/.github/workflows/dev-ci.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: RUNNECT CI - -on: - pull_request: - branches: [ "dev" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: 'gradle' - - - name: make application.properties 파일 생성 - run: | - ## create application.yml - mkdir ./src/main/resources - cd ./src/main/resources - - # application.yml 파일 생성 - touch ./application.yml - - # GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 - echo "${{ secrets.RUNNECT_DEV_APPLICATION }}" >> ./application.yml - - # application.yml 파일 확인 - cat ./application.yml - shell: bash - - # 이 워크플로우는 gradle build - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Build with Gradle # 실제 application build - run: ./gradlew build -PactiveProfiles=local diff --git a/README.md b/README.md index a98d0f3..6752d1f 100644 --- a/README.md +++ b/README.md @@ -152,31 +152,20 @@ ## 🌳 Branch -🌱 git branch 전략 +🌱 Trunk-Based Development -`main branch` : 운영 서버 배포 단위 branch +`main branch` : 유일한 trunk. 항상 배포 가능한 상태를 유지하며, 운영 서버와 staging 서버 모두 이 branch에서 배포된다. -`dev branch` : 주요 개발 branch, main merge 전 거치는 branch, test 서버로 배포되는 branch +`feature branch`: 각 작업 단위의 짧은 수명 branch. `main`에서 분기해 하루~수일 내에 PR로 병합한다. -`feat branch`: 각자 개발 branch +- `main`에서 분기, `feat/#issue번호-작업요약` 형식으로 branch 생성 + - 브랜치명이 `test/...`로 시작하면 GitHub ref 경로 충돌이 나므로 테스트 관련 branch는 `tests/...`(복수형) 사용 +- 작업 완료 후 PR 생성 (base: `main`) + - CI(`build` status check)를 통과해야 병합 가능 + - 미완성 기능은 브랜치를 오래 살려두지 말고, feature flag로 감싸 `main`에 빠르게 합친다 +- 리뷰 완료 후 squash merge, 병합된 branch는 삭제 -- 할 일 issue 등록 후 issue 번호와 isuue 이름으로 branch 생성 후 작업 - - ex) feat/#`issue num`-`isuue name(기능요약)` -- 해당 branch 작업 완료 후 PR 보내기 - - 항상 local에서 충돌 해결 후 → remote에 올리기 - - reviewer에 서로 tag후 code-review - - comment 전 merge 불가! - - review반영 후, 본인이 merge. - -### branch 구조 - -```jsx -- main -- dev -- feat - ├── #1-isuue name1 - └── #2-isuue name2 -``` +과거에는 `dev`/`main` 두 개의 장수 branch를 cherry-pick으로 동기화하는 방식이었으나, 두 branch가 내용상 계속 어긋나는 문제(cherry-pick hell)가 반복되어 폐기했다. staging 배포도 `main` push를 기준으로 트리거된다.