Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:innovationacademy-kr/42cabi into cha…
Browse files Browse the repository at this point in the history
…llenge

# Conflicts:
#	backend/build.gradle
#	backend/build_be.sh
#	backend/src/main/java/org/ftclub/cabinet/cabinet/repository/CabinetOptionalFetcher.java
#	backend/src/main/java/org/ftclub/cabinet/config/CabinetProperties.java
#	backend/src/main/java/org/ftclub/cabinet/config/HaneProperties.java
#	backend/src/main/java/org/ftclub/cabinet/exception/ExceptionStatus.java
#	backend/src/main/java/org/ftclub/cabinet/lent/service/LentFacadeServiceImpl.java
#	backend/src/main/java/org/ftclub/cabinet/occupiedtime/OccupiedTimeController.java
#	backend/src/main/java/org/ftclub/cabinet/occupiedtime/OccupiedTimeManager.java
#	backend/src/main/java/org/ftclub/cabinet/user/domain/User.java
#	backend/src/main/java/org/ftclub/cabinet/user/repository/UserOptionalFetcher.java
#	backend/src/main/java/org/ftclub/cabinet/user/service/UserFacadeServiceImpl.java
#	backend/src/main/java/org/ftclub/cabinet/user/service/UserServiceImpl.java
#	backend/src/test/resources/application.yml
#	config
  • Loading branch information
enaenen committed Oct 26, 2023
2 parents ac2f238 + df882cb commit 2c76240
Show file tree
Hide file tree
Showing 95 changed files with 13,952 additions and 6,713 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/back-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ jobs:
backend-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@v3
with:
submodule: true
- name: 서브모듈 업데이트
run: |
git submodule update --init config
- name: JDK 11 설정
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "corretto"

- name: Application YML 생성
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
- name: Cache Gradle packages
uses: actions/cache@v3
with:
Expand All @@ -35,7 +37,6 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle 빌드
run: |
cd backend
Expand Down
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.

2 changes: 2 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.

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
58 changes: 38 additions & 20 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sourceCompatibility = '11'

ext {
snippetsDir = file('build/generated-snippets')
snippetsDir.mkdirs()
outputDocs = file('src/main/resources/static/docs')
}

Expand Down Expand Up @@ -49,22 +50,24 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-quartz'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'org.modelmapper:modelmapper:3.1.1'

implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// querydsl
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}"

// Monitoring
// Monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-core:1.11.2'
implementation 'io.micrometer:micrometer-registry-prometheus'

// Firebase
implementation 'com.google.firebase:firebase-admin:9.2.0'

// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.2'
Expand All @@ -74,19 +77,11 @@ dependencies {
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.68.Final:osx-aarch_64'
implementation 'org.mapstruct:mapstruct:1.5.5.Final'

// slack
implementation("com.slack.api:bolt-jetty:1.30.0")


runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:2.7.9'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'

// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'it.ozimov:embedded-redis:0.7.2' // 테스트 용도로 내장 서버 Redis 환경 구성

// test
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
Expand All @@ -102,6 +97,29 @@ dependencies {
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
}

tasks.register('copyMainConfig', Copy) {
from '../config/backend/src/main/resources'
into 'src/main/resources'
}

tasks.register('copyTestConfig', Copy) {
from '../config/backend/src/main/resources/test/resources'
into 'src/test/resources'
}

tasks.named('processResources') {
dependsOn 'copyMainConfig'
}

tasks.named('processTestResources') {
dependsOn 'copyTestConfig'
}

tasks.named('compileJava') {
dependsOn 'compileQuerydsl'
}


test {
outputs.dir snippetsDir
useJUnitPlatform()
Expand All @@ -115,15 +133,15 @@ asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
}

tasks.register('copyDocument', Copy) {
dependsOn asciidoctor
from file("${asciidoctor.outputDir}")
into file("${outputDocs}")
}
//
//tasks.register('copyDocument', Copy) {
// dependsOn asciidoctor
// from file("${asciidoctor.outputDir}")
// into file("${outputDocs}")
//}

build {
dependsOn copyDocument
// dependsOn copyDocument
}

jar {
Expand Down
3 changes: 1 addition & 2 deletions backend/build_be.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fi
echo -en $CYAN
if [ "$arg" == "build" ] || [ "$arg" == "re" ] || [ "$arg" == "all" ]; then
echo "Build with Gradle"
mkdir -p build/generated-snippets
./gradlew build --exclude-task test
./gradlew build -x test
fi

echo -en $CYAN
Expand Down
23 changes: 22 additions & 1 deletion backend/database/cabi_local.sql
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,35 @@ CREATE TABLE `user` (
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table `user`
--

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;


DROP TABLE IF EXISTS `lent_extension`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `lent_extension`
(
`lent_extension_id` bigint auto_increment,
`user_id` bigint not null,
`name` varchar(64) not null,
`extension_period` int not null,
`type` varchar(32) not null,
`expired_at` datetime(6) not null,
`used_at` datetime(6) null,
PRIMARY KEY (lent_extension_id),
CONSTRAINT lent_extension_user_user_id_fk
FOREIGN KEY (user_id) REFERENCES user (user_id)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
Expand Down
9 changes: 9 additions & 0 deletions backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ services:
- "80:80"
volumes:
- ../dev/:/etc/nginx/conf.d/
redis:
image: redis:latest
restart: always
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 20s
retries: 10
Binary file modified backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion backend/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions backend/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions backend/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
Loading

0 comments on commit 2c76240

Please sign in to comment.