-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from Soundbar91/develop
테스트용 pr
- Loading branch information
Showing
8 changed files
with
139 additions
and
26 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,60 @@ | ||
name: PR CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- '/**' | ||
pull_request: | ||
branches: | ||
- "develop" | ||
- "main" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql: | ||
image: mysql:8.0.30 | ||
env: | ||
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | ||
MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE_NAME }} | ||
ports: | ||
- 3306:3306 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- 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: Make Application.yml | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
touch ./application-flask.yml | ||
touch ./application.mysql.yml | ||
echo "${{ secrets.APPLICATION }}" > ./application.yml | ||
echo "${{ secrets.FLASK }}" > ./application-flask.yml | ||
echo "${{ secrets.MYSQL }}" > ./application-mysql.yml | ||
- name: Test with Gradle | ||
run: ./gradlew --info test | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
files: build/test-results/**/*.xml | ||
|
||
- name: Cleanup Gradle Cache | ||
if: always() | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.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
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,11 @@ | ||
# base-image | ||
FROM amazoncorretto:17-alpine-jdk | ||
|
||
# continer path | ||
WORKDIR /app | ||
|
||
# jar copy | ||
COPY ./build/libs/retrospect-project-0.0.1-SNAPSHOT.jar /app/app.jar | ||
|
||
# java app.jar | ||
ENTRYPOINT ["java","-jar","/app/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
15 changes: 15 additions & 0 deletions
15
src/main/java/com/soundbar91/retrospect_project/global/config/CorsProperties.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,15 @@ | ||
package com.soundbar91.retrospect_project.global.config; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
@ConfigurationProperties(prefix = "cors") | ||
public class CorsProperties { | ||
private final List<String> allowedOrigins; | ||
} |
19 changes: 8 additions & 11 deletions
19
src/main/java/com/soundbar91/retrospect_project/global/config/SwaggerConfig.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 |
---|---|---|
@@ -1,29 +1,26 @@ | ||
package com.soundbar91.retrospect_project.global.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.servers.Server; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
|
||
@Bean | ||
public OpenAPI openAPI() { | ||
|
||
return new OpenAPI() | ||
.components(new Components()) | ||
.info(apiInfo()) | ||
.addServersItem(new Server().url("/")); | ||
.components(new Components()) | ||
.info(apiInfo()); | ||
} | ||
|
||
private Info apiInfo() { | ||
return new Info() | ||
.title("회고 프로젝트 API") | ||
.description("회고 프로젝트에서 구현된 API를 사용할 수 있습니다.") | ||
.version("1.0.0"); | ||
.title("회고 프로젝트 API") | ||
.description("회고 프로젝트에서 구현된 API를 사용할 수 있습니다.") | ||
.version("1.0.0"); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
spring: | ||
config: | ||
import: application-mysql.yml, application-flask.yml | ||
|
||
jpa: | ||
database: mysql | ||
hibernate: | ||
ddl-auto: validate | ||
|
||
flyway: | ||
enabled: true | ||
|
||
springdoc: | ||
swagger-ui: | ||
operations-sorter: method | ||
|
||
cors: | ||
allowed-origins: | ||
- "http://localhost:8080" | ||
- "https://localhost:8080" | ||
- "http://localhost:5000" |