Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 작업 내용
- 로그인 기능 API 구현
- 로그인 UI 구현
## 리뷰 받고 싶은 부분 (옵션)
- 토큰 인증 필터 로직이 괜찮은지 피드백 부탁드려요
- UI 디자인 괜찮은지 봐주세요
## 회고, 느낀점 (옵션)
- 성능 테스트가 어려웠어요
99 changes: 99 additions & 0 deletions .github/workflows/githubCD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build & Delivery

on:
push:
branches:
- 'main'

env:
REGISTRY: ghcr.io
ORGANIZATION: lgcns-final-lgcms
REPOSITORY: ${{ github.repository }}
REGISTRY_USERNAME: ${{ github.actor }}

jobs:
build:
runs-on: ubuntu-latest
services:
pgvector:
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: lgcms
POSTGRES_PASSWORD: 1234
POSTGRES_DB: testdb
ports:
- 5432:5432
valkey:
image: valkey/valkey:alpine3.22
ports:
- 6379:6379
kafka:
image: bitnamilegacy/kafka:4.0.0-debian-12-r10
env:
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,EXTERNAL://127.0.0.1:9094
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka:9093
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: true
ports:
- 9092:9092
- 9094:9094
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN_GITHUB }}

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Create application-dev.yaml
run: |
mkdir -p src/main/resources
echo "${{ vars.APPLICATION_DEV }}" > src/main/resources/application-dev.yaml

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build with Gradle
id: buildWithGradle
run: ./gradlew clean build
shell: bash

- name: Extract App Name & Version
run: |
echo "APP_NAME=$(./gradlew -q getAppName | perl -pe 's/([A-Z])/-\L$1/g')" >> ${GITHUB_ENV};
echo "APP_VERSION=$(./gradlew -q getAppVersion)" >> ${GITHUB_ENV};

- name: Set Docker Image version
run: |
echo "DOCKER_IMAGE=${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.APP_NAME }}:${{ env.APP_VERSION }}" >> ${GITHUB_ENV}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.TOKEN_GITHUB }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build & Push Docker Image (multi-platform)
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKER_IMAGE }}
65 changes: 65 additions & 0 deletions .github/workflows/githubCI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build & Test

on:
push

env:
REGISTRY: ghcr.io
ORGANIZATION: lgcns-final-lgcms
REPOSITORY: ${{ github.repository }}
REGISTRY_USERNAME: ${{ github.actor }}

jobs:
build:
runs-on: ubuntu-latest
services:
pgvector:
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: lgcms
POSTGRES_PASSWORD: 1234
POSTGRES_DB: testdb
ports:
- 5432:5432
valkey:
image: valkey/valkey:alpine3.22
ports:
- 6379:6379
kafka:
image: bitnamilegacy/kafka:4.0.0-debian-12-r10
env:
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,EXTERNAL://127.0.0.1:9094
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka:9093
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: true
ports:
- 9092:9092
- 9094:9094
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN_GITHUB }}

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build with Gradle
id: buildWithGradle
run: ./gradlew clean build
shell: bash

18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
implementation 'net.bramp.ffmpeg:ffmpeg:0.8.0'
implementation 'org.springframework.kafka:spring-kafka'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
Expand All @@ -48,3 +50,19 @@ dependencyManagement {
tasks.named('test') {
useJUnitPlatform()
}

jar {
enabled = false
}

tasks.register("getAppName") {
doLast {
println("${rootProject.name}")
}
}

tasks.register("getAppVersion") {
doLast {
println("${rootProject.version}")
}
}
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM eclipse-temurin:21-jre-jammy
RUN apt-get update && apt-get install -y ffmpeg \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 8080
COPY build/libs/*.jar /app/app.jar
ENTRYPOINT ["java", "-jar", "/app/app.jar"]


10 changes: 10 additions & 0 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,13 @@ cloud:
auto: false
stack:
auto: false
cdn:
url: ${CND_URL}


ffmpeg:
path: ${FFMPEG_PATH}
ffprobe:
path: ${FFPROBE_PATH}


25 changes: 23 additions & 2 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
application:
name: backend-streaming
kafka:
bootstrap-servers: localhost:9092
bootstrap-servers: localhost:9094

listener:
ack-mode: manual_immediate
Expand All @@ -25,4 +25,25 @@ spring:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
properties:
spring.json.add.type.headers: false
spring.json.add.type.headers: false

cloud:
aws:
s3:
bucket: hello
credentials:
access-key: akey
secret-key: skey
region:
static: ap-northeast-2
auto: false
stack:
auto: false
cdn:
url: asdasd


ffmpeg:
path: asdv
ffprobe:
path: zxcas
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

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

@ActiveProfiles("test")
@SpringBootTest
class StreamingApplicationTests {

Expand Down
Loading