Skip to content
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

졸업을 부탁해 V2.1 #282

Merged
merged 27 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
742257d
refactor: 졸업요건 데이터 코드화 작업 (#235)
5uhwann Jan 19, 2024
2b7fdcb
chore: dn-rule 워크플로우 스크립트 작성 (#237)
5uhwann Jan 22, 2024
2bfdc84
fix: 과목 검색 오류 수정
5uhwann Feb 9, 2024
673a36f
fix: github actions test 깨짐 해결 (#240)
stophwan Feb 15, 2024
825ca3f
feat: 부전공 학생 졸업 요건 검사 기능 (#238)
5uhwann Feb 15, 2024
e98453b
chore: spring RestDocs 관련 설정 제거 (#239)
Hoya324 Feb 15, 2024
bf6e179
[DEV-4] refactor: 패키지 구조 수정 (#243)
Hoya324 Mar 8, 2024
4d92c2c
[DEV-8] Apply Conventions (#245)
5uhwann Mar 19, 2024
1ebe900
[DEV-18] Completed Credit (#247)
5uhwann Apr 9, 2024
834c517
[DEV-28] 커스텀 수강과목 수정 api 분리 생성 삭제 (#249)
Hoya324 Apr 12, 2024
e495969
feat: [DEV-29] CalculateDetailGraduationUseCaseResolver 구현 (#252)
5uhwann Apr 24, 2024
ba9297f
refactor: [DEV-19] 공통교양 상세 졸업 결과 조회 로직 분리 및 api 개발 (#253)
5uhwann May 6, 2024
106c623
[DEV-20] 핵심교양 상세 졸업 결과 조회 로직 분리 및 api 개발 (#255)
5uhwann May 12, 2024
da568bc
[DEV-30] dn-rule alert 스크립트 추가 (#254)
5uhwann May 12, 2024
be4eda0
[DEV-22] 주전공 상세 졸업 결과 조회 로직 분리 및 API 개발 (#257)
5uhwann May 20, 2024
3286a7c
[DEV-24] 테스트 서버 배포 (#261)
5uhwann May 24, 2024
b84c10b
[DEV-26] 주학문기초교양 상세조회 로직 분리 및 API 개발 (#259)
5uhwann May 24, 2024
204ca95
[DEV-21] 유저정보 조회 API 수정 (#263)
5uhwann May 26, 2024
7fcc177
[DEV-31] 과목 검색 API 응답 수정 (#265)
5uhwann May 29, 2024
f74f71a
[DEV-9] 복수전공 졸업 계산 로직 및 조회 API 작성 (#266)
5uhwann Jun 2, 2024
9a36c31
[DEV-33] 복수전공 학문기초교양 졸업계산 로직 수정 (#269)
5uhwann Jun 5, 2024
f6a2b9f
[DEV-35] 학사안내문 업데이트 반영 (#272)
stophwan Jun 13, 2024
b9810ab
[DEV-36] 졸업 검사 코드 리팩토링 (#274)
stophwan Jun 29, 2024
784eb0a
[DEV-37] Codecov 리포트 오류 수정 (#276)
stophwan Jun 30, 2024
a87c889
[DEV-38] 회원탈퇴 오류 수정 (#278)
5uhwann Jun 30, 2024
7debefa
[DEV-40] 기초 영어 유저 로직 작성 (#280)
5uhwann Jul 15, 2024
ed4acc4
[DEV-32] 커스텀 에러코드 적용 (#281)
5uhwann Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .ebextensions/00-makeFiles.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
files:
"/sbin/appstart" :
mode: "000755"
owner: webapp
group: webapp
content: |
#!/usr/bin/env bash
JAR_PATH=/var/app/current/application.jar

# run app
killall java
java -Dfile.encoding=UTF-8 -Dspring.profiles.active=dev -jar $JAR_PATH
3 changes: 3 additions & 0 deletions .ebextensions/00-set-timezone.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
commands:
set_time_zone:
command: ln -f -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
60 changes: 60 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: dev-depoly

on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Build with Gradle
run: ./gradlew clean build
shell: bash

- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00" # 한국 시간에 맞추기 위함

# grandle build를 통해 만들어진 jar를 beanstalk에 배포하기 위한 zip 파일로 만드는 것
- name: Generate deployment package
run: |
mkdir -p deploy
cp build/libs/*.jar deploy/application.jar
cp Procfile deploy/Procfile
cp -r .ebextensions deploy/.ebextensions
cp -r .platform deploy/.platform
cd deploy && zip -r deploy.zip .

# Beanstalk Deploy 플러그인 사용
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} # github secrets로 등록한 값 사용
aws_secret_key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} # github secrets로 등록한 값 사용
application_name: staging-plzgraduation # EB application 이름
environment_name: staging-plzgraduation-env # EB environment 이름
version_label: Github Action-${{steps.current-time.outputs.formattedTime}} # 배포 버전은 타임스탬프를 이용하여 구분
region: ap-northeast-2
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 180

- name: Test with Gradle
run: ./gradlew test --no-daemon
79 changes: 79 additions & 0 deletions .github/workflows/dn-rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: PR Label Automation
on:
schedule:
- cron: '0 10 * * *'

jobs:
update-labels:
runs-on: ubuntu-latest
steps:
- name: Check and Update PR Labels
uses: actions/github-script@v5
with:
script: |
const repo = context.repo;

// Fetch all open PRs
const prs = await github.rest.pulls.list({
owner: repo.owner,
repo: repo.repo,
state: 'open',
});

// Define the Discord webhook URL
const webhookUrl = 'https://discord.com/api/webhooks/1198592354127458326/mighz1RApMReApkYxMy0mJHI97du_nWnBRymuRLldMqgvRDNCme2RIW0fDtS3nEZAKip';

for (const pr of prs.data) {
const prNumber = pr.number;
let labels = pr.labels.map(label => label.name);

// Function to update label
async function updateLabel(oldLabel, newLabel) {
if (oldLabel) {
await github.rest.issues.removeLabel({
owner: repo.owner,
repo: repo.repo,
issue_number: prNumber,
name: oldLabel,
});
}
await github.rest.issues.addLabels({
owner: repo.owner,
repo: repo.repo,
issue_number: prNumber,
labels: [newLabel],
});
}

// Check and update 'D-x' labels
let dLabel = labels.find(label => label.startsWith("D-"));
if (dLabel) {
let day = parseInt(dLabel.split("-")[1]);
if (day > 0) {
const newDayLabel = `D-${day - 1}`;
await updateLabel(dLabel, newDayLabel);
console.log(`Updated label from ${dLabel} to ${newDayLabel} on PR #${prNumber}`);
await fetch(webhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: `Attention! PR #${prNumber} has ${day - 1} day(s) left before the deadline.`,
}),
});
} else if (day === 0) {
await fetch(webhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: `Urgent! PR #${prNumber} is due today!`,
}),
});
}
} else {
await updateLabel(null, 'D-5');
}
}
6 changes: 4 additions & 2 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
# Gradle test를 실행 후 report 추출
- name: Test with Gradle
run: ./gradlew build jacocoTestReport

# report 업로드하기
- name: Upload coverage to Codecov
uses: codecov/[email protected]
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
23 changes: 15 additions & 8 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,26 @@ jobs:
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
${{ runner.os }}-gradle-


# Gradle wrapper 파일 실행 권한주기
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build and analyze
- name: Build with Gradle
run: ./gradlew build --info

- name: Set up JDK 17 for SonarQube
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Run SonarQube analysis with JDK 17
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
run: ./gradlew sonarqube --info
1 change: 1 addition & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TYPE_LIST=(
style
chore
test
build
docs
)

Expand Down
57 changes: 57 additions & 0 deletions .platform/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 33282;

events {
use epoll;
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

include conf.d/*.conf;

map $http_upgrade $connection_upgrade {
default "upgrade";
}

upstream springboot {
server 127.0.0.1:8080;
keepalive 1024;
}

server {
listen 80 default_server;

location / {
proxy_pass http://springboot;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

access_log /var/log/nginx/access.log main;

client_header_timeout 60;
client_body_timeout 60;
client_max_body_size 10M;
keepalive_timeout 60;
gzip off;
gzip_comp_level 4;

# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/healthd.conf;
}
}
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: appstart
52 changes: 8 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id 'java'
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'jacoco'
id "org.sonarqube" version "3.4.0.2513"
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
Expand All @@ -13,20 +12,14 @@ version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
querydsl.extendsFrom compileClasspath
asciidoctorExt
}

repositories {
mavenCentral()
}

ext {
set('snippetsDir', file("build/generated-snippets"))
set('testcontainersVersion', "1.17.3")
set('queryDslVersion', "5.0.0")
}

Expand All @@ -41,45 +34,33 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'com.auth0:java-jwt:4.2.1'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.6'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation "com.google.guava:guava:32.1.3-jre"
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
implementation('org.flywaydb:flyway-core:6.4.2')
// implementation 'org.flywaydb:flyway-core:6.4.2'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.9'
implementation 'io.sentry:sentry-logback:1.7.30'

runtimeOnly 'mysql:mysql-connector-java'
compileOnly 'org.projectlombok:lombok'

annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

testImplementation 'org.testng:testng:7.1.0'
testImplementation 'org.testng:testng:7.9.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:mysql'

asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'

}
testImplementation 'org.testcontainers:testcontainers:1.19.0'
testImplementation 'org.testcontainers:mysql:1.19.0'
testImplementation 'org.testcontainers:junit-jupiter:1.13.0'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
}
}


tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}

tasks.named('test') {
outputs.dir snippetsDir
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
Expand Down Expand Up @@ -112,16 +93,6 @@ sonarqube {
}
}

asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
sources {
include("**/index.adoc")
}
baseDirFollowsSourceFile()
dependsOn test
}

jar {
enabled = false
}
Expand All @@ -140,10 +111,3 @@ sourceSets {
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}

bootJar {
dependsOn asciidoctor
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
10 changes: 0 additions & 10 deletions src/docs/asciidoc/index.adoc

This file was deleted.

Loading
Loading