-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] payment 서버 초기화 설정(#285) #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Deploy Payment Service | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY_PAYMENT }} | ||
| tags: | | ||
| type=sha,prefix={{branch}}- | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: ./payment/Dockerfile | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Test Payment Module | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
| 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' | ||
|
|
||
| - name: Gradle Caching | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Test payment module | ||
| run: ./gradlew --info :payment:test | ||
|
|
||
| - name: Publish test results for payment | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: always() | ||
| with: | ||
| files: 'payment/build/test-results/test/TEST-*.xml' | ||
| check_name: Test Results (payment) | ||
|
|
||
| - name: Publish test report for payment | ||
| uses: mikepenz/action-junit-report@v4 | ||
| if: always() | ||
| with: | ||
| report_paths: 'payment/build/test-results/test/TEST-*.xml' | ||
| check_name: Test Report (payment) | ||
|
|
||
| - name: Upload coverage reports to Codecov for payment | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: payment/build/reports/jacoco/test/jacocoTestReport.xml | ||
| flags: payment | ||
| name: payment-coverage | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| FROM eclipse-temurin:17-jdk AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Gradle wrapper 및 설정 파일 복사 | ||
| COPY gradlew . | ||
| COPY gradle gradle | ||
| COPY build.gradle . | ||
|
|
||
| # payment 빌드를 위한 settings.gradle 생성 (payment만 포함) | ||
| RUN printf "include 'payment'\n" > settings.gradle | ||
|
|
||
| # 의존성 다운로드를 위한 빌드 파일 복사 | ||
| COPY payment/build.gradle payment/build.gradle | ||
|
|
||
| # Gradle wrapper 실행 권한 부여 | ||
| RUN chmod +x gradlew | ||
|
|
||
| # 의존성 다운로드 | ||
| RUN ./gradlew :payment:dependencies --no-daemon || true | ||
|
|
||
| # 전체 소스 코드 복사 | ||
| COPY payment payment | ||
|
|
||
| # 빌드 실행 | ||
| RUN ./gradlew :payment:clean :payment:build -x test --no-daemon | ||
|
|
||
|
|
||
| FROM eclipse-temurin:17-jre | ||
|
|
||
| RUN groupadd -g 10001 appgroup \ | ||
| && useradd -u 10001 -g appgroup -s /usr/sbin/nologin -m appuser | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=builder /app/payment/build/libs/*.jar /app/app.jar | ||
redblackblossom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| RUN chown appuser:appgroup /app/app.jar | ||
|
|
||
| USER appuser | ||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| ENTRYPOINT ["java", "-jar", "/app/app.jar"] | ||
redblackblossom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'org.springframework.boot' version '3.5.10' | ||
redblackblossom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id 'io.spring.dependency-management' version '1.1.7' | ||
| id 'jacoco' | ||
| } | ||
|
|
||
| group = 'net.catsnap' | ||
| version = '0.0.1-SNAPSHOT' | ||
| description = 'Catsnap Payment Service' | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(17) | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| jacoco { | ||
| toolVersion = "0.8.7" | ||
| } | ||
|
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find all Jacoco toolVersion declarations across modules
rg "toolVersion" --glob "*/build.gradle" -n -B 1 -A 1Repository: CUKCatSnap/CUKCATSNAP_Server Length of output: 950 🌐 Web query:
💡 Result: JaCoCo 0.8.7 has only experimental compatibility with Java 17:
Practical takeaway: If you need dependable Java 17 coverage, use JaCoCo ≥ 0.8.8 (0.8.7 is “experimental” for Java 17). [1] Sources: [1] JaCoCo change history / 0.8.7–0.8.8 notes, [2] JaCoCo users list (maintainer reply referencing 0.8.7 + runtime minimum), [3] JaCoCo Maven plugin prerequisites. Jacoco 0.8.7은 Java 17 호환성을 위해 0.8.12로 업그레이드 권장됩니다. 0.8.7은 Java 17에 대한 실험적 지원만 제공하며, 공식적인 지원은 0.8.8 이상에서 시작됩니다. 현재 프로젝트에서 일관성 없게 0.8.7 (payment, reservation, gateway, authentication, mono)과 0.8.12 (event-schema-shared, authorization-shared)가 혼용 중이므로, 모든 모듈을 0.8.12로 통일하는 것을 권장합니다. 🤖 Prompt for AI Agents |
||
|
|
||
| jacocoTestReport { | ||
| reports { | ||
| html.required = true | ||
| xml.required = true | ||
| csv.required = false | ||
| } | ||
| } | ||
|
|
||
| test { | ||
| finalizedBy jacocoTestReport | ||
| } | ||
|
|
||
| jacocoTestReport { | ||
| finalizedBy jacocoTestCoverageVerification | ||
| } | ||
redblackblossom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| dependencies { | ||
| implementation 'org.springframework.boot:spring-boot-starter-web' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
| } | ||
|
|
||
| tasks.named('test') { | ||
| useJUnitPlatform() | ||
| } | ||
|
Comment on lines
+48
to
+50
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
|
Comment on lines
+1
to
+7
|
||
Uh oh!
There was an error while loading. Please reload this page.