Skip to content

Commit

Permalink
Merge pull request #99 from Kernel360/develop
Browse files Browse the repository at this point in the history
V1.0.0 update
  • Loading branch information
gunsight1 authored Jan 29, 2024
2 parents fd96815 + 6d3d5ab commit 51bf5e1
Show file tree
Hide file tree
Showing 204 changed files with 10,739 additions and 81 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/washpedia-이슈-템플릿.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Washpedia 이슈 템플릿
about: 프로젝트 개발 관련 이슈 템플릿
title: ''
labels: "\U0001F5A5️ BackEnd"
assignees: ''

---

| 📝 **Description**

`무엇에 관한 이슈인지 설명해 주세요`

| 🖥️ **Tasks**

- [ ] _이슈와 관련하여 할 일을 추가해 주세요_
- [ ] _세부적인 할 일을 추가해 주세요_

---

| **Additional**

_이 이슈와 관련된 다른 이슈, 참고 자료 등을 작성해 주세요_
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 💡 Motivation and Context
`여기에 왜 이 PR이 필요했는지, PR을 통해 무엇이 바뀌는지에 대해서 설명해 주세요`

<br>

## 🔨 Modified
> 여기에 무엇이 크게 바뀌었는지 설명해 주세요
- _여기에 세부 변경사항을 설명해주세요_

<br>

## 🌟 More
- _여기에 PR 이후 추가로 해야 할 일에 대해서 설명해 주세요_

<br>

---


### 📋 커밋 전 체크리스트
- [ ] 추가/변경에 대한 단위 테스트를 완료하였습니다.
- [ ] 컨벤션에 맞게 작성하였습니다.

<br>

### 🤟🏻 PR로 완료된 이슈
closes #
20 changes: 20 additions & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Korean
PROMPT: 당신은 능력 있는 10년차 시니어 개발자로서 프로젝트의 코드 리뷰를 담당하고 있습니다. 코드 리뷰는 한국어로 작성하고 단순하거나 큰 이슈가 없다면 굳이 리뷰하지 않아도 됩니다. 추가로 코드 리뷰를 할 때 일일이 설명하지 않고 꼭 필요한 부분만 짚어서 짧게 설명해주셔도 됩니다.
57 changes: 57 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Java CI with Gradle WashPedia Project

on:
push:
branches: [ "send_develop_server" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

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

- name: Replace SQL Queries
run: |
sql_directory="./module-api/src/main/resources/db/migration"
old_text="changeRequired"
new_text="${{ secrets.PUBLIC_KEY }}"
find "$sql_directory" -type f -name "*.sql" -exec sed -i "s|$old_text|$new_text|g" {} +
- name: Grant execute permission for gradlew
working-directory: ./module-api
run: chmod +x ./gradlew

- name: Build with Gradle
working-directory: ./module-api
run: ./gradlew build

- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Copy JAR file to remote server using SCP
run: |
cd module-api/build/libs/
export PASSWORD="${{ secrets.VULTR_PW }}"
sshpass -p "$PASSWORD" scp -o StrictHostKeyChecking=no -P 22 module-api-0.0.1-SNAPSHOT.jar ${{ secrets.VULTR_USER_NAME }}@${{ secrets.VULTR_IP }}:/root
## 터미널 접속 후 실행 -> 수정 필요
- name: Application Run on Remote Server
run: |
export JAR_NAME="module-api-0.0.1-SNAPSHOT.jar"
export PASSWORD="${{ secrets.VULTR_PW }}"
sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no ${{ secrets.VULTR_USER_NAME }}@${{ secrets.VULTR_IP }} \
"pgrep -f java | xargs kill -9 && \
cd \$HOME && \
echo pwd && \
mkdir -p ./logs && \
nohup java -jar $JAR_NAME --jasypt.encryptor.password=${{ secrets.PUBLIC_KEY }} >> ./logs/deploy_success.log 2> ./logs/deploy_error.log & "
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
#!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

Expand Down Expand Up @@ -39,5 +39,8 @@ out/
### MAC ###
.DS_Store

### rest docs ###
!**/src/main/**/static/docs

### log ###
*.log
29 changes: 7 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
}

group = 'com.kernel360'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
sourceCompatibility = '17'
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.flywaydb:flyway-core'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}

tasks.named('test') {
useJUnitPlatform()
}
useJUnitPlatform()
}
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3.8'
services:
webapp:
build: ./module-api
image: ${WEBAPP_IMAGE}
ports:
- "8080:8080"
depends_on:
- db-edit

batch:
build: ./module-batch
image: ${BATCH_IMAGE}
ports:
- "8082:8082"
depends_on:
- db-edit
#
# admin:
# build: ./module-admin
# ports:
# - "8083:8080"
# depends_on:
# - db-read

db-edit:
image: younglong/pg-washpedia:latest
volumes:
- ./postgreReadOnlyDB:/var/lib/postgresql/data
environment:
POSTGRES_DB: edit_db
POSTGRES_USER: ${USER}
POSTGRES_PASSWORD: ${PASSWORD}
ports:
- "5432:5432"

# db-read:
# image: younglong/pg-washpedia:latest
# volumes:
# - ./postgreEditDB:/var/lib/postgresql/data
# environment:
# POSTGRES_DB: read_db
# POSTGRES_USER: ${{ secrets.PROJECT_USER }}
# POSTGRES_PASSWORD: ${{ secrets.POSTGRE_PASSWORD }}
# ports:
# - "5433:5433"

volumes:
db-read-volume: {}
db-edit-volume: {}
5 changes: 5 additions & 0 deletions module-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:17-jdk
CMD ["./gradlew", "clean", "build"]
ARG JAR_FILE=./build/libs/module-api-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} washpedia.jar
ENTRYPOINT ["java", "-jar", "washpedia.jar"]
98 changes: 98 additions & 0 deletions module-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id "org.asciidoctor.jvm.convert" version "3.3.2"
}

group = 'com.kernel360'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}

ext {
snippetsDir = file('build/generated-snippets')
}

configurations {
asciidoctorExt
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation project(':module-common')
implementation project(':module-domain')

// spring-boot-starter
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//implementation 'org.springframework.boot:spring-boot-starter-security'

// jasypt
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'

// flyway
implementation 'org.flywaydb:flyway-core'

// postgresql
runtimeOnly 'org.postgresql:postgresql'

//lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// validataion
implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.4'

// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

// test - fixture Monkey
testImplementation 'net.jqwik:jqwik:1.7.3'
testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.0")
testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.0.0")

// rest docs
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
}

tasks.named('test') {
outputs.dir snippetsDir
useJUnitPlatform()
}

asciidoctor {
dependsOn test
configurations 'asciidoctorExt'
baseDirFollowsSourceFile()
inputs.dir snippetsDir
}

asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}

task copyDocument(type: Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}

bootJar {
dependsOn copyDocument
}

tasks.register("prepareKotlinBuildScriptModel") {}
Binary file added module-api/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions module-api/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 51bf5e1

Please sign in to comment.