forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Milestone/#4
- Loading branch information
Showing
261 changed files
with
22,031 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy/v1 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ./backend/moment/moment-server | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 # 원하는 Java 버전으로 변경 | ||
distribution: 'temurin' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- run: touch ./backend/moment/moment-server/auth/src/main/resources/application.properties | ||
- run: echo "${{ secrets.AUTH_PROPERTIES }}" > ./backend/moment/moment-server/auth/src/main/resources/application.properties | ||
|
||
- run: touch ./backend/moment/moment-server/core/src/main/resources/application.properties | ||
- run: echo "${{ secrets.CORE_PROPERTIES }}" > ./backend/moment/moment-server/core/src/main/resources/application.properties | ||
|
||
- run: touch ./backend/moment/moment-server/mail/src/main/resources/application.properties | ||
- run: echo "${{ secrets.MAIL_PROPERTIES }}" > ./backend/moment/moment-server/mail/src/main/resources/application.properties | ||
|
||
- run: touch ./backend/moment/moment-server/scheduler/src/main/resources/application.properties | ||
- run: echo "${{ secrets.SCHEDULER_PROPERTIES }}" > ./backend/moment/moment-server/scheduler/src/main/resources/application.properties | ||
|
||
|
||
# - run: cat ./src/main/resources/application.properties | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
# | ||
# - name: Build with Gradle | ||
# uses: gradle/gradle-build-action@v2 | ||
# with: | ||
# arguments: build -x test | ||
# build-root-directory: ./backend/moment/moment-server | ||
# gradle-version: 7.5 | ||
# | ||
# - name: Deploy to Server | ||
# uses: actions/checkout@v3 | ||
|
||
# - run: | | ||
# docker-compose up --build | ||
# working-directory: ${{ env.working-directory }} | ||
|
||
# 서버에 애플리케이션 배포 스크립트 실행 | ||
# 예: scp, SSH, Docker, Kubernetes 등을 사용하여 배포 | ||
deploy: | ||
env: | ||
working-directory: ./backend/moment/moment-server | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Add Server key | ||
run: | | ||
touch key.txt | ||
echo "${{ secrets.SERVER_KEY }}" > key.txt | ||
chmod 600 key.txt | ||
working-directory: ${{ env.working-directory }} | ||
- name: Deploy the application | ||
env: | ||
SERVER_HOST: ${{ secrets.SERVER_HOST }} | ||
SERVER_PORT: ${{ secrets.SERVER_PORT }} | ||
SERVER_USER: ${{ secrets.SERVER_USER }} | ||
run: | | ||
chmod 755 ./deploy.sh | ||
set -e | ||
./deploy.sh | ||
working-directory: ${{ env.working-directory }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 도커 허브에서 공식적으로 제공하는 OpenJDK 이미지를 베이스 이미지로 사용합니다. | ||
FROM openjdk:17-jdk-slim | ||
|
||
# 빌드에 필요한 패키지를 설치합니다. | ||
RUN apt-get update && apt-get install -y findutils && rm -rf /var/lib/apt/lists/* | ||
|
||
# 작업 디렉토리를 생성합니다. | ||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
# Gradle 캐시를 미리 복사하여 의존성 다운로드 시간을 단축합니다. | ||
#COPY .gradle .gradle | ||
|
||
# 프로젝트 소스 코드와 Gradle 설정 파일을 복사합니다. | ||
COPY build.gradle gradlew ./ | ||
COPY gradle gradle | ||
COPY src src | ||
|
||
# Gradle을 이용하여 프로젝트를 빌드합니다. | ||
RUN --mount=type=cache,target=/root/.gradle ./gradlew build -x test | ||
|
||
# 빌드 결과물을 Docker 이미지 안에 포함시킵니다. 이건 호스트에서 가져올떄 COPY고 컨테이너 내부에서 빌드한 파일을 복사할때 cp | ||
#COPY build/libs/*SNAPSHOT.jar app.jar | ||
RUN cp build/libs/*SNAPSHOT.jar app.jar | ||
|
||
|
||
# 컨테이너가 실행될 때 자동으로 실행할 명령어를 설정합니다. | ||
CMD ["java", "-jar", "app.jar"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
backend/moment/moment-server/auth/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Copyright 2012-2024 the original author or authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
14 changes: 14 additions & 0 deletions
14
backend/moment/moment-server/auth/src/docs/asciidoc/Auth.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
== Auth | ||
:doctype: book | ||
:source-highlighter: highlightjs | ||
:sectlinks: | ||
:toc: left | ||
:toclevels: 3 | ||
=== 로그인 | ||
operation::auth/login[snippets="http-request,request-body,request-fields,http-response,response-fields"] | ||
=== 비밀번호 변경 | ||
operation::auth/changePassword[snippets="http-request,request-headers,request-body,request-fields,http-response,response-fields"] | ||
=== 인증코드 요청 | ||
operation::auth/sendCode[snippets="http-request,request-body,request-fields,http-response,response-fields"] | ||
=== 인증코드 확인 | ||
operation::auth/verifyCode[snippets="http-request,request-headers,request-body,request-fields,http-response,response-fields"] |
10 changes: 10 additions & 0 deletions
10
backend/moment/moment-server/auth/src/docs/asciidoc/index.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// index.adoc | ||
= Moment Application API Document | ||
:doctype: book | ||
:source-highlighter: highlightjs | ||
:sectlinks: | ||
:toc: left | ||
:toclevels: 3 | ||
|
||
include::Auth.adoc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ment/moment-server/auth/src/test/java/com/moment/auth/config/DocumentFormatGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.moment.auth.config; | ||
|
||
import org.springframework.restdocs.snippet.Attributes; | ||
|
||
import static org.springframework.restdocs.snippet.Attributes.key; | ||
|
||
public interface DocumentFormatGenerator { | ||
|
||
static Attributes.Attribute getDateFormat() { // (2) | ||
return key("format").value("yyyy-MM-dd"); | ||
} | ||
|
||
static Attributes.Attribute getDateTimeFormat() { // (2) | ||
return key("format").value("yyyy-MM-dd'T'HH:mm:ss"); | ||
} | ||
|
||
static Attributes.Attribute getBooleanFormat() { // (3) | ||
return key("format").value("true or false"); | ||
} | ||
} |
Oops, something went wrong.