Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#3
Browse files Browse the repository at this point in the history
  • Loading branch information
sss4920 authored Dec 27, 2023
2 parents a52b21c + 6bf09b5 commit 951b196
Show file tree
Hide file tree
Showing 24 changed files with 186 additions and 20 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: issue_template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---

## ✨ About Issue ✨
<!-- 이슈에 대한 내용을 설명해주세요. -->

<br>

## ✅ Todo
<!-- 해야 할 일들을 적어주세요. -->
- [ ] todo !
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## 🚩 관련 이슈
- close #

## 📋 구현 기능 명세
- [x]

## 📌 PR Point
- 무슨 이유로 어떻게 코드를 변경했는지


- 어떤 부분에 리뷰어가 집중해야 하는지


- 개발하면서 어떤 점이 궁금했는지

## 📸 결과물 스크린샷
```java
결과 예시 사진 첨부
```

## 🛠️ 테스트
- [x] 테스트

## 🚀 API Endpoint
-
63 changes: 63 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CD

on:
push:
branches: [ "develop" ]

jobs:
deploy-ci:
runs-on: ubuntu-22.04
env:
working-directory: linkmind

steps:
- uses: actions/checkout@v3

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

- name: application.yaml 생성
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION }}" > ./application-dev.yaml
working-directory: ${{ env.working-directory }}

- name: 빌드
run: |
chmod +x gradlew
./gradlew build -x test
working-directory: ${{ env.working-directory }}
shell: bash

- name: docker build 가능하도록 환경 설정
uses: docker/[email protected]

- name: docker hub에로그인
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_LOGIN_ACCESSTOKEN }}

- name: docker image 빌드 및 푸시
run: |
docker build --platform linux/amd64 -t mmihye/toaster .
docker push mmihye/toaster
working-directory: ${{ env.working-directory }}

deploy-cd:
needs: deploy-ci
runs-on: ubuntu-22.04

steps:
- name: 도커 컨테이너 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RELEASE_SERVER_IP }}
username: ${{ secrets.RELEASE_SERVER_USER }}
key: ${{ secrets.RELEASE_SERVER_KEY }}
script: |
cd ~
./deploy.sh
34 changes: 34 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
branches: [ "develop" ]

jobs:
build:
runs-on: ubuntu-22.04
env:
working-directory: linkmind

steps:
- name: 체크아웃
uses: actions/checkout@v3

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

- name: application.yaml 생성
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION }}" > ./application.yaml
working-directory: ${{ env.working-directory }}

- name: 빌드
run: |
chmod +x gradlew
./gradlew build -x test
working-directory: ${{ env.working-directory }}
shell: bash
4 changes: 4 additions & 0 deletions linkmind/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ out/
.vscode/
application-dev.yml
application-local.yml
/src/test/resources/application-dev.yml
/src/test/resources/application-local.yml
/src/main/resources/application-dev.yml
/src/main/resources/application-local.yml
7 changes: 7 additions & 0 deletions linkmind/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM amd64/amazoncorretto:17

WORKDIR /app

COPY ./build/libs/toaster-0.0.1-SNAPSHOT.jar /app/toaster.jar

CMD ["java", "-Duser.timezone=Asia/Seoul", "-jar", "-Dspring.profiles.active=dev", "toaster.jar"]
6 changes: 4 additions & 2 deletions linkmind/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'mysql:mysql-connector-java:8.0.32'
compileOnly 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
//implementation 'org.springframework.boot:spring-boot-starter-security'
//testImplementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}

tasks.named('test') {
Expand Down
2 changes: 1 addition & 1 deletion linkmind/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'linkmind'
rootProject.name = 'toaster'
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.app.linkmind;
package com.app.toaster;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class LinkmindApplication {
public class ToasterApplication {

public static void main(String[] args) {
SpringApplication.run(LinkmindApplication.class, args);
SpringApplication.run(ToasterApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.app.linkmind.common.advice;
package com.app.toaster.common.advice;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.app.linkmind.common.dto.ApiResponse;
import com.app.linkmind.exception.model.CustomException;
import com.app.toaster.common.dto.ApiResponse;
import com.app.toaster.exception.model.CustomException;

import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.app.linkmind.common.dto;
package com.app.toaster.common.dto;

import com.app.linkmind.exception.Error;
import com.app.linkmind.exception.Success;
import com.app.toaster.exception.Error;
import com.app.toaster.exception.Success;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.app.toaster.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HealthCheckController {

@GetMapping("/health")
public String healthCheck() {
return "OK";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.app.linkmind.exception;
package com.app.toaster.exception;

import org.springframework.http.HttpStatus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.app.linkmind.exception;
package com.app.toaster.exception;

import org.springframework.http.HttpStatus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.app.linkmind.exception.model;
package com.app.toaster.exception.model;

import com.app.linkmind.exception.Error;
import com.app.toaster.exception.Error;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.app.linkmind.exception.model;
package com.app.toaster.exception.model;

import com.app.linkmind.exception.Error;
import com.app.toaster.exception.Error;

public class NotFoundException extends CustomException {
public NotFoundException(Error error, String message) {
Expand Down
1 change: 1 addition & 0 deletions linkmind/src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.app.linkmind;
package com.app.toaster;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class LinkmindApplicationTests {
class ToasterApplicationTests {

@Test
void contextLoads() {
Expand Down

0 comments on commit 951b196

Please sign in to comment.