Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 committed May 14, 2024
2 parents ed94554 + 7e4911a commit 8db7e58
Show file tree
Hide file tree
Showing 203 changed files with 8,023 additions and 24 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/♻️-refactor.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
name: "♻️ REFACTOR"
about: 리팩토링 템플릿입니다.
title: "♻️ [REFACTOR]"
title: "♻️ refactor: "
labels: refactor
assignees: ''

---

# Title

- 리팩토링

# TODO

- [ ] 리팩토링

# etc

- 흐읍
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
name: "FEATURE"
name: "FEAT"
about: 기능 개발 이슈템플릿입니다.
title: "[FEATURE]"
labels: feature
title: "feat: "
labels: feat
assignees: ''

---

# Title

- 숨쉬기 기능 개발

# TODO

- [ ] 간지나게 숨쉬기

# etc

- 어쩌구저쩌구
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/🐛-bug.md

This file was deleted.

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/🐛-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "🐛 FIX"
about: 버그 수정 템플릿입니다.
title: "🐛 fix: "
labels: fix
assignees: ''

---

# Title

- 숨쉬기 기능 버그 발견

# TODO

- [ ] 숨참기

# etc

- 흐읍
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/👷️-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "👷 CI"
about: 배포 작업 템플릿입니다.
title: "👷 ci: "
labels: ci
assignees: ''

---

# Title

- xx

# TODO

- [ ] 작업 내용

# etc

- 흐읍
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/📝️-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "📝 DOCS"
about: 문서 작업 템플릿입니다.
title: "📝 docs: "
labels: docs
assignees: ''

---

# Title

- xx 문서 작업

# TODO

- [ ] 작업 내용

# etc

- 흐읍
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 📎 Issue Number
-
# ☝️Issue Number

- resolves #

# 🔎 Key Changes
-
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/cd_gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CD

on:
workflow_dispatch:
push:
branches: [ "develop" ]

permissions:
contents: read

jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

## gradle 캐싱
- name: Gradle Caching
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
## create application.yml
- name: make application-secret.yml
run: |
mkdir -p ./api/src/main/resources
touch ./api/src/main/resources/application-secret.yml
shell: bash
- name: deliver application-secret.yml
run: echo "${{ secrets.APPLICATION_SECRET }}" > ./api/src/main/resources/application-secret.yml
shell: bash

## firebase-key 설정
- name: Set FCM
env:
DATA: ${{ secrets.FIREBASE_KEY }}
run: |
mkdir -p ./core/core-infra-firebase/src/main/resources/firebase
echo $DATA > ./core/core-infra-firebase/src/main/resources/firebase/firebase-key.json
# 빌드 및 테스트 단계.
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# gradle build
- name: Build with Gradle
run: ./gradlew build -x test

# push 하기 위해 로그인
- name: Docker Hub 로그인
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

#도커 빌드 & 이미지 push
- name: Docker build & Push
run: |
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/sponus-docker .
docker push ${{ secrets.DOCKER_USERNAME }}/sponus-docker
# Docker 파일을 EC2 서버에 배포
- name: Deploy to Prod
uses: appleboy/ssh-action@master
id: deploy-prod
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
if [ ! -z "$(docker ps -q)" ]; then
docker stop $(docker ps -q)
fi
if [ ! -z "$(docker ps -aq)" ]; then
docker rm $(docker ps -aq)
fi
if [ ! -z "$(docker network ls -qf name=my-network)" ]; then
docker network rm my-network
fi
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
docker pull ${{ secrets.DOCKER_USERNAME }}/sponus-docker
docker pull redis
docker network create my-network
docker run --name my-redis --network my-network -d redis
docker run -e SPRING_PROFILES_ACTIVE=prod -it -d -p 8080:8080 --name sponus-docker -e TZ=Asia/Seoul --network my-network ${{ secrets.DOCKER_USERNAME }}/sponus-docker
docker system prune -f
23 changes: 23 additions & 0 deletions .github/workflows/ci_gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
ci:
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: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew test
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Created by https://www.toptal.com/developers/gitignore/api/java,gradle
# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle

*-secret.yml
**/src/main/generated/
**/firebase/*.json

# Mac os
*.Ds_Store

# IntelliJ
*.idea

### Java ###
# Compiled class file
*.class

Expand All @@ -22,3 +36,32 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Gradle ###
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof

# End of https://www.toptal.com/developers/gitignore/api/java,gradle
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17-jdk
ARG JAR_FILE=./api/build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "/app.jar"]
33 changes: 33 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Read Me First
The following was discovered as part of building this project:

* The original package name 'com.sponus.sponus-be' is invalid and this project uses 'com.sponus.sponusbe' instead.

# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Gradle documentation](https://docs.gradle.org)
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.1/gradle-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.1/gradle-plugin/reference/html/#build-image)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.2.1/reference/htmlsingle/index.html#web)
* [Spring Security](https://docs.spring.io/spring-boot/docs/3.2.1/reference/htmlsingle/index.html#web.security)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.2.1/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)

### Guides
The following guides illustrate how to use some features concretely:

* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)

### Additional Links
These additional references should also help you:

* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)

Loading

0 comments on commit 8db7e58

Please sign in to comment.