Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…sue-BE into feature/WHAT-43
  • Loading branch information
kjyyjk committed Sep 11, 2023
2 parents 1621b9a + 20a269d commit 61e0300
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 📌 관련 이슈
<!-- 관련있는 이슈 번호(#000)을 적어주세요.
해당 pull request merge와 함께 이슈를 닫으려면
closed #Issue_number를 적어주세요 -->

## ✨ 변경 내용
<!-- 과제에 대한 설명을 적어주세요
- 변경한 클래스/코드 등 에대한 설명을 적어주세요 <br>
- 백엔드같은 경우 postman api 동작 화면을 캡쳐해서 적어주세요 <br>
- api url 도 적어주세요 <br>
- 코드를 적어야 할때에는 ```이 특수문자를 활용하여 적어주시면 됩니다.
-->

## 📸 스크린샷(선택)
<!-- postmain api 동작 화면을 보여주세요 -->

## 📚 레퍼런스 (또는 새로 알게 된 내용) 혹은 궁금한 사항들
<!-- 참고할 사항이 있다면 적어주세요 -->
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: 버그 이슈 작성
title: "[BugFix]"
labels: "\U0001F41EBugFix"
assignees: ''

---

---
name: Bug request
about: 버그 이슈
title: "[Bug]"
labels: BugFix
assignees: ''

---
##Description
> 이슈에 대한 설명 작성해주세요
## Progress
- [ ] todo1
- [ ] todo2
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Feature request
about: 기능 이슈 작성
title: "[FEAT]"
labels: "✨Feat"
assignees: ''

---

---
name: Feature request
about: 기능 이슈
title: "[FEAT]"
labels: feat
assignees: ''

---

---
name: 기능 이슈 작성
about: Suggest an idea for this project
title: "[FEAT]"
labels: feat
assignees: ''

---

##Description
> 이슈에 대한 설명 작성해주세요
## Progress
- [ ] todo1
- [ ] todo2
63 changes: 63 additions & 0 deletions .github/workflows/cd_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 작업명
name: CD NCP

# 실행해야 할 브랜치, push가 발생한 경우로만 한정하였다.
on:
push:
branches:
- 'develop'
- 'main'

jobs:
CD:
## NCP OS : Ubuntu 18.04
runs-on: ubuntu-18.04

steps:
## Project JDK 20 Setting
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'


# Gradle의 사용권한 셋팅
- name: Grant Execute permission for gradlew
run: chmod +x gradlew
shell: bash

# 프로젝트 테스트 진행없이 빌드
- name: Build with Gradle
run: ./gradlew build -x test
shell: bash

# Docker 빌드 생성 및 푸시
- name: dev Docker build & push
if: contains(github.ref, 'main') || contains(github.ref, 'develop')
run: |
echo ${{ secrets.SONG_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker build -f Dockerfile -t ghcr.io/${{ github.repository }}/whatssue:1.0 .
docker push ghcr.io/${{ github.repository }}/whatssue:1.0
# 개발서버 SSH접속 및 배포
- name: Deploy
uses: appleboy/ssh-action@master
id: deploy
if: contains(github.ref, 'develop') || contains(github.ref, 'develop')
with:
host: ${{ secrets.NCP_DEV_SERVER_IP }}
username: ${{ secrets.NCP_DEV_SERVER_USER }}
password: ${{ secrets.NCP_DEV_SERVER_PASSWORD }}
port: ${{ secrets.NCP_DEV_SERVER_SSH_PORT }}
script: |
echo "${{ secrets.GITHUB_TOKEN }}" | sudo ghcr.io login -u ${{ github.actor }} --password-stdin
sudo docker rm -f $(docker ps -q -a)
sudo docker pull ghcr.io/${{ github.repository }}/whatssue:1.0
sudo docker run -d -p 8090:8090 --name whatssue ghcr.io/${{ github.repository }}/whatssue:1.0
sudo docker rm -f $(docker ps -q -a)
docker image prune -f
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Base image
FROM openjdk:20-jdk

# Set working directory
WORKDIR /app

# Copy the JAR file from the build output directory to the container
COPY build/libs/*.jar Whatssue.jar

# Expose port (if your Spring Boot application uses a different port, update it here)
EXPOSE 8090

# Command to run the Spring Boot application when the container starts
CMD ["java", "-jar", "Whatssue.jar"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Whatssue-BE
양파시 광산동 팀 "왓슈?" 백엔드
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ repositories {
}

dependencies {
//http://server:8090/swagger-ui.html
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.1.0'

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'
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/gdg/whatssue/configuration/SprindocConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package gdg.whatssue.configuration;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//http://localhost:8090/swagger-ui/index.html
@Configuration
public class SprindocConfig {
@Bean
public OpenAPI WhatssueOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("Whatssue OpenApi")
.description("소모임 출석 관리 application_ Whatssue?의 Open API입니다.")
.version("V0.0.1")
.contact(new Contact()
.name("whatssue")
.email("[email protected]")))
.externalDocs(new ExternalDocumentation()
.description("Whatssue Github")
.url("https://github.com/whatever-mentoring/Whatssue-BE"));
}

// 후에 spring security 사용할떄는 SecurityConfig 에서 뚫어주기
// "/v3/api-docs/**",
// "/swagger-ui/**",
// "/swagger-resources/**",
}
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ spring:
jpa:
hibernate:
ddl-auto: update
mvc:
pathmatch:
matching-strategy: ant_path_matcher
server:
port: '8090'

0 comments on commit 61e0300

Please sign in to comment.