Skip to content

Commit

Permalink
Merge pull request #1456 from innovationacademy-kr/dev
Browse files Browse the repository at this point in the history
DEV TO MAIN, CABI V5
  • Loading branch information
enaenen authored Nov 27, 2023
2 parents 1e93066 + 9dfd55d commit 98e7c4f
Show file tree
Hide file tree
Showing 273 changed files with 20,977 additions and 8,470 deletions.
97 changes: 56 additions & 41 deletions .github/workflows/back-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ jobs:
java-version: "11"
distribution: "corretto"

- name: Application YML 생성
- name: Setup Dev Environment
if: ${{ 'refs/heads/dev' == github.ref }}
run: |
mkdir -p backend/src/main/resources
echo "${{ secrets.APPLICATION_PROD_YML }}" | base64 --decode > backend/src/main/resources/application-prod.yml
echo "${{ secrets.APPLICATION_DEV_YML }}" | base64 --decode > backend/src/main/resources/application-dev.yml
echo "${{ secrets.APPLICATION_AUTH_YML }}" | base64 --decode > backend/src/main/resources/application-auth.yml
echo "${{ secrets.APPLICATION_MAIL_YML }}" | base64 --decode > backend/src/main/resources/application-mail.yml
echo "ENVIRONMENT=dev" >> $GITHUB_ENV
echo "S3_BUCKET=dev.cabi-server-deploy" >> $GITHUB_ENV
echo "CODEDEPLOY_APP=cabi-dev" >> $GITHUB_ENV
echo "CODEDEPLOY_GROUP=cabi-dev-group" >> $GITHUB_ENV
echo "DOCKER_IMAGE=ccabi/cabi-dev" >> $GITHUB_ENV
- name: Setup Main Environment
if: ${{ 'refs/heads/main' == github.ref }}
run: |
echo "ENVIRONMENT=main" >> $GITHUB_ENV
echo "S3_BUCKET=main.cabi-server-deploy" >> $GITHUB_ENV
echo "CODEDEPLOY_APP=cabi-main" >> $GITHUB_ENV
echo "CODEDEPLOY_GROUP=cabi-main-group" >> $GITHUB_ENV
echo "DOCKER_IMAGE=ccabi/cabi-main" >> $GITHUB_ENV
- name: Cache Gradle packages
uses: actions/cache@v3
Expand All @@ -41,53 +51,58 @@ jobs:
cd backend
mkdir -p build/generated-snippets/
chmod +x gradlew
./gradlew build
./gradlew build -x test
shell: bash

- name: Log in to Docker Hub
if: ${{ format('refs/heads/{0}', env.ENVIRONMENT) == github.ref }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
if: ${{ format('refs/heads/{0}', env.ENVIRONMENT) == github.ref }}
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
tags: latest

- name: Build and push Docker image
if: ${{ format('refs/heads/{0}', env.ENVIRONMENT) == github.ref }}
uses: docker/build-push-action@v5
with:
context: .
file: ./deploy-${{ env.ENVIRONMENT }}/pinpoint-application/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Configure AWS credentials
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' }}
if: ${{ format('refs/heads/{0}', env.ENVIRONMENT) == github.ref }}
uses: aws-actions/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: Dev S3에 업로드
if: ${{ github.ref == 'refs/heads/dev' }}
run: |
echo "${{ secrets.PINPOINT_APPLICATION_DEV_ENV }}" | base64 --decode > deploy-dev/pinpoint-application/.env
echo "${{ secrets.PINPOINT_AGENT_DEV_ENV }}" | base64 --decode > deploy-dev/pinpoint-agent/.env
cp backend/build/libs/cabinet-*.jar deploy-dev/pinpoint-application/build
mkdir -p deploy && cp -r deploy-dev/* deploy/
zip -r deploy.zip deploy
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_DEV_BUCKET_NAME }}/deploy.zip
aws deploy create-deployment \
--application-name ${{ secrets.AWS_CODEDEPLOY_DEV_APP_NAME }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ secrets.AWS_CODEDEPLOY_DEV_GROUP_NAME }} \
--file-exists-behavior OVERWRITE \
--s3-location bucket=${{ secrets.AWS_S3_DEV_BUCKET_NAME }},bundleType=zip,key=deploy.zip
- name: Main S3에 업로드
if: ${{ github.ref == 'refs/heads/main' }}
- name: Upload to S3 and deploy
if: ${{ format('refs/heads/{0}', env.ENVIRONMENT) == github.ref }}
run: |
echo "${{ secrets.PINPOINT_APPLICATION_PROD_ENV }}" | base64 --decode > deploy-main/pinpoint-application/.env
echo "${{ secrets.PINPOINT_AGENT_PROD_ENV }}" | base64 --decode > deploy-main/pinpoint-agent/.env
cp backend/build/libs/cabinet-*.jar deploy-main/pinpoint-application/build
env_file="deploy-${{ env.ENVIRONMENT }}/pinpoint-application/.env"
agent_env_file="deploy-${{ env.ENVIRONMENT }}/pinpoint-agent/.env"
echo "${{ secrets[format('PINPOINT_APPLICATION_{0}_ENV', env.ENVIRONMENT)] }}" | base64 --decode > $env_file
echo "${{ secrets[format('PINPOINT_AGENT_{0}_ENV', env.ENVIRONMENT)] }}" | base64 --decode > $agent_env_file
mkdir -p deploy && cp -r deploy-main/* deploy/
mkdir -p deploy && cp -r deploy-${{ env.ENVIRONMENT }}/* deploy/
zip -r deploy.zip deploy
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_MAIN_BUCKET_NAME }}/deploy.zip
aws s3 cp deploy.zip s3://${{ env.S3_BUCKET }}/deploy.zip
aws deploy create-deployment \
--application-name ${{ secrets.AWS_CODEDEPLOY_MAIN_APP_NAME }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ secrets.AWS_CODEDEPLOY_MAIN_GROUP_NAME }} \
--file-exists-behavior OVERWRITE \
--s3-location bucket=${{ secrets.AWS_S3_MAIN_BUCKET_NAME }},bundleType=zip,key=deploy.zip
--application-name ${{ ENV.CODEDEPLOY_APP }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ ENV.CODEDEPLOY_GROUP }} \
--file-exists-behavior OVERWRITE \
--s3-location bucket=${{ env.S3_BUCKET }},bundleType=zip,key=deploy.zip
17 changes: 14 additions & 3 deletions .github/workflows/front-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ jobs:
frontend-CI:
runs-on: ubuntu-latest
steps:
- name: Make ssh file
run: |
mkdir -p ~/.ssh
echo '${{ secrets.SSH_CONFIG }}' | base64 -d > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
- name: 체크아웃
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodule: true
- name: 서브모듈 업데이트
run: |
git submodule update --init config
- name: Node.js 16.x Version
uses: actions/setup-node@v1
with:
Expand All @@ -28,10 +39,10 @@ jobs:
# run: npm run lint --prefix frontend
- name: Dev env 파일 생성
if: ${{ github.ref == 'refs/heads/dev' }}
run: echo "${{ secrets.FRONTEND_DEV_ENV }}" | base64 --decode > frontend/.env
run: cat ./config/frontend/dev.env > ./frontend/.env
- name: Main env 파일 생성
if: ${{ github.ref == 'refs/heads/main' }}
run: echo "${{ secrets.FRONTEND_MAIN_ENV }}" | base64 --decode > frontend/.env
run: cat ./config/frontend/main.env > ./frontend/.env
- name: 빌드 체크
run: npm run build --prefix frontend
# - name: 단위 테스트 체크
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ aria_log.*
ib_logfile*
ibdata*
ibtmp*
*nohup.out
*nohup.out
/backend/src/main/resources/test/resources/
6 changes: 3 additions & 3 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 16 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<a href="https://cabi.oopy.io/">
<img src="https://user-images.githubusercontent.com/45951630/151654792-3e064ca8-f2e6-4a13-945a-626705152957.png" width="400px" alt="42Cabi" />
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/13278955/278554161-83bfed83-e148-44e5-8389-b49598725ce4.png" width="400px" alt="Cabi" />
</a>

[![GitHub Stars](https://img.shields.io/github/stars/innovationacademy-kr/42cabi?style=for-the-badge)](https://github.com/innovationacademy-kr/42cabi/stargazers) [![GitHub Stars](https://img.shields.io/github/issues/innovationacademy-kr/42cabi?style=for-the-badge)](https://github.com/innovationacademy-kr/42cabi/issues) [![Current Version](https://img.shields.io/badge/version-4.0.0-black?style=for-the-badge)](https://github.com/IgorAntun/node-chat) [![GitHub License](https://img.shields.io/github/license/innovationacademy-kr/42cabi?style=for-the-badge)](https://github.com/IgorAntun/node-chat/issues)
Expand All @@ -23,21 +23,24 @@
- https://cabi.42seoul.io/

### 프로젝트 목표

- 캐비닛 대여 서비스: 42서울의 캐비닛 400여 개를 편리하게 대여 및 반납할 수 있는 서비스
- 효율적이고 원활한 서비스: 제한된 자원으로 많은 사용자가 원활하게 사용할 수 있는 서비스
- 관리자 플랫폼: 캐비닛 대여 현황 및 상태를 도식화하여 관리자의 작업이 수월한 플랫폼

### 프로젝트 내용

- 클러스터 별 캐비닛 배치도를 바탕으로 실제 위치에 따른 캐비닛 대여 현황을 확인할 수 있습니다.
- 클러스터에 방문할 필요 없이 간편하게 캐비닛 대여 및 반납이 가능합니다.
- 캐비닛마다 `READ` / `UPDATE` 가능한 메모장을 제공합니다.
- 공유 캐비닛의 경우, 캐비닛 사용자들끼리만 공유 가능한 메모장을 제공합니다.

### 기술적 도전

- 지속할 수 있고, 확장할 수 있는 서비스를 지향하고, 한정된 자원으로 **증가하는 사용자**들에게 양질의 서비스를 제공하기 위해 **42Cabi**은 다음과 같이 노력했습니다:
- 지속할 수 있고, 확장할 수 있는 서비스를 지향하고, 한정된 자원으로 **증가하는 사용자**들에게 양질의 서비스를 제공하기 위해 **Cabi**은 다음과 같이 노력했습니다:

#### [Common](https://github.com/innovationacademy-kr/42cabi/)

- 유지/보수와 기능 추가가 용이하도록 코딩 컨벤션을 정하고, 문서화 작업 및 이슈 관리를 체계화했습니다.
- Notion, Slack 등의 협업 툴들을 이용하여 팀원 간 정보 시차와 격차를 줄였습니다.
- 주기적이지만 유동적인 회의를 통해 목표와 분업을 명확히 하여 효과적인 협업을 진행했습니다.
Expand All @@ -48,7 +51,7 @@
- 웹, 모바일 환경에서도 이용에 불편함이 없도록 반응형 웹 디자인을 적용했습니다.
- 사용자가 쉽게 캐비닛을 찾을 수 있도록 실제 사용 공간에 따른 맵을 표시했습니다.
- 원활한 사용자 경험을 위해 페이지를 포함한 캐러셀을 구현했습니다.
- 사용자가 서비스 상태를 명확하게 인지할 수 있도록 로딩과 에러 코드에 따른 렌더링을 구현했습니다.
- 사용자가 서비스 상태를 명확하게 인지할 수 있도록 로딩과 에러 코드에 따른 렌더링을 구현했습니다.
- 정책이나 UI/UX 등 빠르게 변화하는 환경을 원활히 반영할 수 있도록 하드코딩을 피하고 props와 환경변수를 이용해 유지보수성을 높였습니다.

#### [BackEnd](https://github.com/innovationacademy-kr/42cabi/tree/dev/backend)
Expand Down Expand Up @@ -149,34 +152,25 @@

## 🧑‍💻 프로젝트 멤버




<div align="center">


| [🐇dongglee](https://github.com/leedonggyu1848) | [🍑 eunbikim](https://github.com/eunbi9n) | [🥔 gyuwlee](https://github.com/gyutato) | [🐬huchoi](https://github.com/hunjin-choi) | [👻 hybae](https://github.com/HyeonsikBae) |
| ----------------------------------------- | ---------------------------------------- | ------------------------------------------ | --------------------------------------- | ------------------------------------------ |


| ----------------------------------------------- | ----------------------------------------- | ---------------------------------------- | ------------------------------------------ | ------------------------------------------ |

| [🍒 hyoon](https://github.com/kamg2218) | [🍏 hyospark](https://github.com/kyoshong) | [🙉 inshin](https://github.com/42inshin) | [🧑‍✈️ jaesjeon](https://github.com/Oris482) | [🐶 jiwchoi](https://github.com/jiwon-choi) |
| ----------------------------------------- | ---------------------------------------- | ------------------------------------------ | --------------------------------------- | ------------------------------------------ |
| [🍒 hyoon](https://github.com/kamg2218) | [🍏 hyospark](https://github.com/kyoshong) | [🙉 inshin](https://github.com/42inshin) | [🧑‍✈️ jaesjeon](https://github.com/Oris482) | [🐶 jiwchoi](https://github.com/jiwon-choi) |
| --------------------------------------- | ------------------------------------------ | ---------------------------------------- | ----------------------------------------- | ------------------------------------------- |

| [🐯 joopark](https://github.com/joohongpark) | [🚀sanan](https://github.com/Ssuamje) | [🐻 seuan](https://github.com/aseungbo) | [🤑seycho](https://github.com/SeyoungCho) | [😺 sichoi](https://github.com/sichoi42) |
| ----------------------------------------- | ------------------------------------------- | -------------------------------------------- | --------------------------------------- | ---------------------------------------- |
| [🐯 joopark](https://github.com/joohongpark) | [🚀sanan](https://github.com/Ssuamje) | [🐻 seuan](https://github.com/aseungbo) | [🤑seycho](https://github.com/SeyoungCho) | [😺 sichoi](https://github.com/sichoi42) |
| -------------------------------------------- | ------------------------------------- | --------------------------------------- | ----------------------------------------- | ---------------------------------------- |

| [🍎 skim](https://github.com/subin195-09) | [🍪 spark](https://github.com/Hyunja27) | [✏️yooh](https://github.com/oyhoyhk) | [🪀 yoyoo](https://github.com/Yoowatney) | [🎒 yubchoi](https://github.com/yubinquitous) |
| ----------------------------------------- | ------------------------------------------- | -------------------------------------------- | --------------------------------------- | ---------------------------------------- |

| [ 🌑 daewoole](https://github.com/LeeDaeWook) | [🐝 hyungnoh](https://github.com/YESHYUNGSEOK) | [원 jpark2](https://github.com/Z1park) | [🎨 junsohn](https://github.com/junyoung2015) |[🤓 seong-hui ](https://github.com/seong-hui) | [🚀 wchae](https://github.com/enaenen) |
| ----------------------------------------- | ------------------------------------------- | -------------------------------------------- | --------------------------------------- | ---------------------------------------- | ---------------------------------------- |


| <a href="https://github.com/innovationacademy-kr"><img src="https://img.shields.io/badge/42Seoul-000000?style=flat-square&logo=42&logoColor=white" /></a> |
| ----------------------------------------- |
| ----------------------------------------- | --------------------------------------- | ------------------------------------ | ---------------------------------------- | --------------------------------------------- |

| [ 🌑 daewoole](https://github.com/LeeDaeWook) | [🐝 hyungnoh](https://github.com/YESHYUNGSEOK) | [원 jpark2](https://github.com/Z1park) | [🎨 junsohn](https://github.com/junyoung2015) | [🤓 seong-hui ](https://github.com/seong-hui) | [🚀 wchae](https://github.com/enaenen) |
| --------------------------------------------- | ---------------------------------------------- | -------------------------------------- | --------------------------------------------- | --------------------------------------------- | -------------------------------------- |

| <a href="https://github.com/innovationacademy-kr"><img src="https://img.shields.io/badge/42Seoul-000000?style=flat-square&logo=42&logoColor=white" /></a> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- |

</div>
<br/>
Expand Down
5 changes: 4 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ out/
application*.yml
!application.yml

**/static/docs
**/static/docs

### Firebase ###
*firebase*.json
Loading

0 comments on commit 98e7c4f

Please sign in to comment.