Skip to content

Commit

Permalink
mege main into qa
Browse files Browse the repository at this point in the history
  • Loading branch information
jcy0308 committed Apr 23, 2024
2 parents 879f92d + 249bce0 commit 2c92039
Show file tree
Hide file tree
Showing 27 changed files with 1,397 additions and 976 deletions.
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ❗ SCG Project Bug report
description: Report bug to SCG Project
title: "[BUG] "
labels: ['bug', 'pending']
body:
- type: textarea
attributes:
label: Description 📖
id: bug-description
description: |
발생한 버그에 대해 상세하게 설명해주세요
validations:
required: true
- type: textarea
attributes:
label: Reproduction 🏗️
id: bug-reproduction
description: |
버그 reproduction 방법을 자세히 설명해주세요
사진, 동영상 혹은 해당 버그가 발생한 링크 등을 남기면 개발시간을 더욱 더 단축시킬 수 있습니다!🙇
value: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: Logs 🪵
id: bug-log
description: |
버그가 발생했을 때의 Log를 남겨주시면 더욱 더 해결하는 데 도움이 됩니다!🙇
render: shell
- type: textarea
attributes:
label: Environment 🖥️
id: bug-environment
description: |
버그가 발생한 환경에 대해 설명해주세요 (브라우저, OS, 하드웨어 등)
- type: checkboxes
id: bug-checkboxes
attributes:
label: CheckList ✔️
description: |
Issue 올리기 전에 한 번 확인해주세요! 👍
options:
- label: 관련 Issue 가 이미 존재하는 지 확인해보셨나요?
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 🚀 SCG Project New Feature Request
description: Propose new feature to SCG Project
title: "🚀 "
labels: ['enhancement', 'pending']
body:
- type: textarea
attributes:
label: Describe Existing Problem ❓
id: feature-problem
description: |
해결하려는 문제를 자세히 설명해주세요!
validations:
required: true
- type: textarea
attributes:
label: Describe Solution 💸
id: feature-solution
description: |
위의 문제를 해결하기 위해 어떤 기능을 추가하고 싶은 지 설명해주세요!
validations:
required: true
- type: textarea
attributes:
label: Describe Alternatives 💼
id: feature-solution
description: |
위의 문제를 해결하기 위해 고민한 다른 방법들에 대해서도 자유롭게 서술해주세요!
- type: checkboxes
id: feature-checkboxes
attributes:
label: CheckList ✔️
description: |
Issue 올리기 전에 한 번 확인해주세요! 👍
options:
- label: 관련 Issue 가 이미 존재하는 지 확인해보셨나요?
required: true
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
작성자: @github_nickname

## 체크 리스트

- [ ] 적절한 제목으로 수정했나요?
- [ ] 상단에 이슈 번호를 기입했나요?
- [ ] Target Branch를 올바르게 설정했나요?
- [ ] Label을 알맞게 설정했나요?

## 작업 내역

- 작업한 내용을 간략하게 작성해주세요.

## 비고

- 참고 사항을 적어주세요. 코드 리뷰하는 사람이 참고해야 하는 내용을 자유로운 형식으로 적을 수 있습니다.

close/resolve/fix #{이슈 번호 기입}
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Docker Image CI

on:
push:
branches: ["main"]
env:
dockerimage_tag: ${{ github.sha }}
dockerimage_name: harbor.k8s.scg.skku.ac.kr/library/ice-gs-thesis-be
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: --------------- Code Repo ---------------
run: echo "Code Repo"
- name: Code Repo 불러오기
uses: actions/checkout@v4
- name: Docker 준비(1/4) - 메타데이터 생성
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: |
${{ env.dockerimage_name }}
tags: |
${{ env.dockerimage_tag }}
latest
flavor: |
latest=true
- name: Docker 준비(2/4) - QEMU 설정
uses: docker/setup-qemu-action@v3
- name: Docker 준비(3/4) - buildx 설정
uses: docker/setup-buildx-action@v3
- name: Docker 준비(4/4) - 레지스트리 로그인
uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: env 파일 생성
run: |
echo APP_ENV=${{secrets.APP_ENV}} >> .env
echo APP_PORT=${{secrets.APP_PORT}} >> .env
echo DATABASE_URL="${{secrets.DATABASE_URL_PROD}}" >> .env
echo JWT_SECRET="${{secrets.JWT_SECRET}}" >> .env
echo MINIO_END_POINT="${{secrets.MINIO_END_POINT}}" >> .env
echo MINIO_PORT=${{secrets.MINIO_PORT}} >> .env
echo MINIO_ACCESS_KEY="${{secrets.MINIO_ACCESS_KEY}}" >> .env
echo MINIO_SECRET_KEY="${{secrets.MINIO_SECRET_KEY}}" >> .env
echo MINIO_BUCKET_NAME="${{secrets.MINIO_BUCKET_NAME_PROD}}" >> .env
cat .env
- name: Docker 이미지 빌드+푸시
id: build-and-push
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: --------------- Config Repo ---------------
run: echo "[Config Repo]"
- name: Config Repo 불러오기
uses: actions/checkout@v4
with:
repository: SystemConsultantGroup/ice-grad-thesis-config
ref: main
token: ${{ secrets.ACTION_TOKEN }}
path: ice-grad-thesis-config
- name: Kustomize 준비
uses: imranismail/setup-kustomize@v2.0.0
- name: Config Repo 이미지 값 업데이트 (Kustomize)
run: |
cd ice-grad-thesis-config/overlays/prod/be/
kustomize edit set image ${{ env.dockerimage_name }}:${{ env.dockerimage_tag }}
cat kustomization.yaml
- name: Config Repo 변경사항 푸시
run: |
cd ice-grad-thesis-config
git config --global user.email "wefwef12e@naver.com"
git config --global user.name "hynseok"
git commit -am "Update image tag"
git push -u origin main
- name: --------------- Clean Up ---------------
run: echo "Clean Up"
9 changes: 3 additions & 6 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
env:
dockerimage_tag: ${{ github.sha }}
dockerimage_name: harbor.k8s.scg.skku.ac.kr/library/ice-gs-thesis-be
DATABASE_URL_QA: ${{secrets.DATABASE_URL_QA}}
JWT_SECRET: ${{secrets.JWT_SECRET}}
MINIO_SECRET_KEY: ${{secrets.MINIO_SECRET_KEY}}
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,12 +43,12 @@ jobs:
run: |
echo APP_ENV=${{secrets.APP_ENV}} >> .env
echo APP_PORT=${{secrets.APP_PORT}} >> .env
echo DATABASE_URL=$DATABASE_URL_QA >> .env
echo JWT_SECRET=$JWT_SECRET >> .env
echo DATABASE_URL=${{secrets.DATABASE_URL_QA}} >> .env
echo JWT_SECRET=${{secrets.JWT_SECRET}} >> .env
echo MINIO_END_POINT=${{secrets.MINIO_END_POINT}} >> .env
echo MINIO_PORT=${{secrets.MINIO_PORT}} >> .env
echo MINIO_ACCESS_KEY=${{secrets.MINIO_ACCESS_KEY}} >> .env
echo MINIO_SECRET_KEY=$MINIO_SECRET_KEY >> .env
echo MINIO_SECRET_KEY=${{secrets.MINIO_SECRET_KEY}} >> .env
echo MINIO_BUCKET_NAME=${{secrets.MINIO_BUCKET_NAME_QA}} >> .env
cat .env
- name: Docker 이미지 빌드+푸시
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ lerna-debug.log*
!.vscode/extensions.json

# Prisma
migrations/
migrations/

# Environment
.env
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ COPY tsconfig.json ./
COPY tsconfig.build.json ./
COPY .env ./

RUN apk update
RUN apk upgrade
RUN apk add --no-cache udev ttf-freefont chromium

ENV LANG=ko_KR.UTF-8
ENV LANGUAGE=ko_KR.UTF-

# package.json, package-lock.json
COPY package*.json ./
RUN npm install
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
### local (port=4000)
### Overall Structure
![image](https://github.com/SystemConsultantGroup/real-ice-gs-thesis-backend/assets/60565169/ec77a2c2-8400-457b-8dd6-df2b92461082)


### local에서 실행 (port=4000)
local 환경에 맞는 .env 파일 생성
```bash
npm i
npm install
npx prisma db seed
npm run start
```

### 개발중..
- PDF 생성 모듈 MSA 전환
Loading

0 comments on commit 2c92039

Please sign in to comment.