Skip to content

Commit

Permalink
Merge pull request #6 from taco-official/develop
Browse files Browse the repository at this point in the history
v0.0.0
  • Loading branch information
ohhamma authored Jul 12, 2024
2 parents 245aebf + f6d154e commit ddb3c6b
Show file tree
Hide file tree
Showing 16 changed files with 641 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
> 타입(지라 이슈키): 설명
## 📌 연관된 이슈
> 지라 이슈 링크
## 📝 작업 내용
> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
## 🌳 작업 브랜치명
> 현재 작업중인 브랜치를 적어주세요
## 📸 스크린샷 (선택)

## 💬 리뷰 요구사항 (선택)
> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
53 changes: 53 additions & 0 deletions .github/workflows/makefile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Makefile CI

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.8

build:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.8

- name: Run build
run: make build

- name: Run test code
run: make test

- name: Run docker
run: make up
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
64 changes: 64 additions & 0 deletions .gitmessage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 커밋 메시지 템플릿
# - 형식: <jira issue key>/<type>: <short summary>
# ▼ <header> 작성

# ▼ <빈 줄>

# ▼ <body> 작성

# ▼ <빈 줄>

# ▼ <footer> 작성

# 작성 형식 설명
# - 일반 커밋
# <header>
# <jira issue key>
# - jira issue key 알아서 넣으세용
# <type>
# - feat: 새로운 기능 추가
# - fix: 버그 수정
# - docs: 문서 수정
# - style: 코드 포맷팅, 세미콜론 누락, 코드 변경이 없는 경우
# - design: 사용자 UI 변경 (CSS 변경 등)
# - refactor: 코드 리팩토링
# - test: 테스트 코드, 리팩토링 테스트 코드 추가
# - chore: 빌드 업무 수정, 패키지 매니저 수정, production code와 무관한 부분들 (.gitignore, build.gradle 같은)
# - comment: 주석 추가 및 변경
# - rename: 파일, 폴더명 수정
# - remove: 파일, 폴더 삭제
# <short summary>
# - 필수 입력
# - 변경 사항을 간결하게 설명
# - 첫글자 소문자, 현재 시제, 명령문으로 마지막에 .(마침표) 없이 작성
#
# <body>
# - 최소 20자 필수 입력(<type>docs 제외)
# - 현재 시제, 명령문으로 작성
# - 변경 사항의 동기(왜)를 설명
# - 변경 효과를 설명하기 위해 이전 동작과 현재 동작의 비교를 포함할 수 있음
#
# <footer>
# - Breaking Changes, deprecations 또는 이 커밋이 close하거나 연관된 깃헙 이슈, 지라 티켓, 풀리퀘스트 포함
# - 예시
# - 1. Breaking Changes
# BREAKING CHANGE: <breaking change 요약>
# <빈 줄>
# <breaking change 설명 + migration 지시>
# <빈 줄>
# <빈 줄>
# Fixes #<issue number>
# - 2. deprecations
# DEPRECATED: <deprecated 된 것>
# <빈 줄>
# <deprecation 설명 + 추천 update 경로>
# <빈 줄>
# <빈 줄>
# Closes #<pr 번호>
#
# - Revert 커밋
# <header>
# revert: <revert 대상 커밋의 헤더>
# <body>
# - This reverts commit <revert 대상 커밋의 SHA>
# - revert 이유에 대한 명확한 설명
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM openjdk:17-jdk

# JAR_FILE 변수 정의 -> 기본적으로 jar file이 2개이기 때문에 이름을 특정해야함
ARG JAR_FILE=./build/libs/klkl-0.0.1-SNAPSHOT.jar

# JAR 파일 메인 디렉토리에 복사
COPY ${JAR_FILE} app.jar

# 시스템 진입점 정의
ENTRYPOINT ["java", "-jar", "/app.jar"]
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
DOCKER_ID := $(shell docker ps -aq)
DOCKER_IMAGE := $(shell docker images -q)
DOCKER_VOLUME := $(shell docker volume ls -q)

up:
@make build
docker compose up --build -d

down:
docker compose down

compile:
@./gradlew classes

build:
@make clean
@./gradlew build

test:
@./gradlew test

log:
docker compose logs

clean:
@./gradlew clean

fclean:
@make clean
$(if $(DOCKER_ID), docker rm -f $(DOCKER_ID))
$(if $(DOCKER_VOLUME), docker volume rm $(DOCKER_VOLUME))
$(if $(DOCKER_IMAGE), docker rmi $(DOCKER_IMAGE))

re:
@make fclean
@make up

.PHONY: up down compile build test log clean fclean re
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
}

group = 'taco'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
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-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
useJUnitPlatform()
}
6 changes: 6 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "3"
services:
spring:
build: .
ports:
- 8080:8080
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions 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.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ddb3c6b

Please sign in to comment.