Skip to content

Commit 888ded0

Browse files
dlsrks1021sehee123LimKangHyunsilver-eunjoojiwon1217
authored
test docker build (#2)
* ✨ feat: 웹소켓 config 파일 생성 * ✨ 웹소켓 config 파일 생성 * chore: Java 스타일 수정 * ♻️ refactor:sockJS 제거 --------- Co-authored-by: github-actions <> * ✨ feat: GitHub Action 자동 Release 추가 (prgrms-web-devcourse-final-project#8) * ✨ feat: GitHub Action 자동 테스트 추가 (prgrms-web-devcourse-final-project#10) * fix: Test DB 미등록으로 인한 테스트 실패 문제 해결 * feat: test workflow 등록 * fix: build.gradle tab 문자 적용 * chore: Java 스타일 수정 --------- Co-authored-by: github-actions <> * ✨ feat: SSE 기본 연결 기능 구현 (prgrms-web-devcourse-final-project#11) * ✨ feat: SSE 기본 기능 구현 * chore: Java 스타일 수정 * 🚚 rename: SSE 관련 파일 패키지 구분 추가 * chore: Java 스타일 수정 * 🗑️ remove: SSE 관련 중복 파일 삭제 --------- Co-authored-by: github-actions <> * ✨ feat: 게임 방 생성 구현 * ✨ feat: 게임 방 생성 구현 * ✨ feat: repository, service 책임 분리, mapper추가 * chore: Java 스타일 수정 * ♻️ 리뷰 반영 수정 * chore: Java 스타일 수정 * 🩹 컨트롤러 import 추가 * chore: Java 스타일 수정 --------- Co-authored-by: github-actions <> * ✨ feat: 게임 방 전체 목록 조회 구현 * 🔧 chore: Quiz, User에 @Getter 및 임시 @Setter 추가 * chore: Java 스타일 수정 * ✨ feat: 룸 목록 조회 응답 DTO(RoomListResponse) 추가 - RoomResponse 추가 * chore: Java 스타일 수정 * ✨ feat: 룸 전체 조회 API 구현 * chore: Java 스타일 수정 * ✅ test: 룸 전체 조회 리포지토리 테스트 추가 * chore: Java 스타일 수정 * ♻️ 리뷰 반영 수정 - RoomService의 RoomMapper를 static import로 변경 - roomResponse DTO의 title을 roomName으로 변경 --------- Co-authored-by: github-actions <> * ✨ feat : 퀴즈 생성 기능 구현 * ✨ feat : 게임 방 입장(+유효성 검증) 구현 * ✨ 게임 방 입장(+유효성 검증) 구현 * ♻️ 누락 import 추가 * ♻️ 클라이언트 send시 로그 추가 * chore: Java 스타일 수정 * ♻️ PR 리뷰 반영 * chore: Java 스타일 수정 * 🔥 refactor: validationResponse삭제 no content로 응답 변경으로 인한 응답 dto 삭제 * ♻️ PR 리뷰 반영-2 * ♻️ PR 리뷰 반영-2 * ✨ 유효성 체크 요청시 validation 어노테이션 추가 * chore: Java 스타일 수정 --------- Co-authored-by: github-actions <> * [feat] Kakao OAuth 회원가입, 로그인, 로그아웃 기능 (prgrms-web-devcourse-final-project#24) * 🔧 chore: Kakao OAuth 기능 관련 설정 * ✨ feat: Kakao Oauth 회원가입, 로그인, 로그아웃 구현 * chore: Java 스타일 수정 * chore: Java 스타일 수정 --------- Co-authored-by: github-actions <> * feat: Github Action 자동 도커 이미지 빌드 추가 (#1) --------- Co-authored-by: hwangsehee <[email protected]> Co-authored-by: kanghyun <[email protected]> Co-authored-by: Lee Eunjoo (Silver) <[email protected]> Co-authored-by: Jiwon Kwak <[email protected]>
1 parent 162c62c commit 888ded0

File tree

87 files changed

+1976
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1976
-166
lines changed

.github/workflows/bump-version.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: release
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: haya14busa/action-bumpr@v1

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: haya14busa/action-bumpr@v1
17+
18+
package:
19+
runs-on: ubuntu-latest
20+
needs: release
21+
22+
permissions:
23+
contents: read
24+
packages: write
25+
attestations: write
26+
id-token: write
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
38+
- uses: docker/metadata-action@v5
39+
id: meta
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
type=raw,value=latest
44+
type=raw,value=${{ needs.release.outputs.current_version }}
45+
46+
- uses: docker/build-push-action@v6
47+
with:
48+
context: ./backend
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
branches: [ dev ]
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
env:
11+
PROJECT_DIR: backend
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
24+
- name: Run tests
25+
run: ./gradlew test
26+
working-directory: ${{ env.PROJECT_DIR }}
27+
28+
- name: Upload test report
29+
if: always()
30+
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: junit-test-report
34+
path: ${{ env.PROJECT_DIR }}/build/reports/tests/test
35+
include-hidden-files: true

backend/.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,13 @@ out/
4040
.env
4141

4242
### .idea ###
43-
.idea
43+
.idea
44+
45+
### websocket test ###
46+
src/main/resources/static/ws-test.html
47+
src/main/resources/static/ws-test.js
48+
49+
50+
51+
### images/thumbnail ###
52+
images/thumbnail/**

backend/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM gradle:jdk21 AS builder
2+
WORKDIR /app
3+
COPY . .
4+
RUN ./gradlew clean build -x test
5+
6+
FROM openjdk:21-slim
7+
WORKDIR /app
8+
COPY --from=builder /app/build/libs/*.jar app.jar
9+
ENTRYPOINT ["java", "-jar", "app.jar"]

backend/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ dependencies {
2929
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
3030
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
3131
implementation 'org.springframework.boot:spring-boot-starter-websocket'
32+
implementation 'org.springframework.boot:spring-boot-starter-security'
33+
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
3234

3335
/* DATABASE */
3436
runtimeOnly 'com.mysql:mysql-connector-j'
@@ -38,6 +40,8 @@ dependencies {
3840
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
3941
testImplementation 'org.projectlombok:lombok'
4042
testAnnotationProcessor 'org.projectlombok:lombok'
43+
testRuntimeOnly 'com.h2database:h2'
44+
testImplementation 'org.springframework.security:spring-security-test'
4145

4246
/* ETC */
4347
annotationProcessor 'org.projectlombok:lombok'

backend/src/main/java/io/f1/backend/BackendApplication.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
@SpringBootApplication
99
public class BackendApplication {
1010

11-
public static void main(String[] args) {
12-
SpringApplication.run(BackendApplication.class, args);
13-
}
14-
11+
public static void main(String[] args) {
12+
SpringApplication.run(BackendApplication.class, args);
13+
}
1514
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
package io.f1.backend.domain.admin.entity;
22

33
import io.f1.backend.global.entity.BaseEntity;
4+
45
import jakarta.persistence.Column;
56
import jakarta.persistence.Entity;
67
import jakarta.persistence.GeneratedValue;
78
import jakarta.persistence.GenerationType;
89
import jakarta.persistence.Id;
10+
911
import java.time.LocalDateTime;
1012

1113
@Entity
1214
public class Admin extends BaseEntity {
1315

14-
@Id
15-
@GeneratedValue(strategy = GenerationType.IDENTITY)
16-
private Long id;
17-
18-
@Column(nullable = false)
19-
private String username;
16+
@Id
17+
@GeneratedValue(strategy = GenerationType.IDENTITY)
18+
private Long id;
2019

21-
@Column(nullable = false)
22-
private String password;
20+
@Column(nullable = false)
21+
private String username;
2322

24-
@Column(nullable = false)
25-
private LocalDateTime lastLogin;
23+
@Column(nullable = false)
24+
private String password;
2625

26+
@Column(nullable = false)
27+
private LocalDateTime lastLogin;
2728
}

backend/src/main/java/io/f1/backend/domain/game/ConnectionState.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

backend/src/main/java/io/f1/backend/domain/game/GameSetting.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)