From 0fb1d33841f3aaf3af761cbce07453d95ff394d2 Mon Sep 17 00:00:00 2001 From: wonjuneee Date: Fri, 4 Jul 2025 17:51:00 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=EC=9E=90=EB=8F=99=20=EB=9D=BC?= =?UTF-8?q?=EB=B2=A8=EB=A7=81=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/labeler.yml | 6 ++++ .github/workflows/gradle.yml | 67 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 30 ++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..ea99ed7 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,6 @@ +develop: + - head-branch: ['^feature'] + +bug: + - head-branch: ['^bugfix', '^hotfix'] + diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..106f413 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,67 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'openjdk' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # with: + # gradle-version: '8.9' + # + # - name: Build with Gradle 8.9 + # run: gradle build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'openjdk' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..b7898da --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,30 @@ +name: Labeler + +on: + issues: + types: + - opened + - edited + pull_request: + types: + - opened + - reopened + pull_request_target: + types: + - opened + - reopened + +jobs: + main: + runs-on: ubuntu-latest + + permissions: + contents: read # 위에 작성한 설정 파일을 읽기 위해 필요 + issues: write # 이슈에 라벨을 추가하기 위해 필요 + pull-requests: write # PR에 라벨을 추가하기 위해 필요 + + steps: + - name: Labeler + uses: actions/labeler@v5.0.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" From 5899c7c10edd6fd134ef23dfd6e52d81ce58a7ad Mon Sep 17 00:00:00 2001 From: wonjuneee Date: Fri, 4 Jul 2025 17:51:20 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=EA=B8=B0=EB=B3=B8=20docker=20comp?= =?UTF-8?q?ose=20=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 compose.yaml diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..cfcf7ec --- /dev/null +++ b/compose.yaml @@ -0,0 +1,54 @@ +services: + postgres: + image: 'postgres:latest' + environment: + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_USER=${POSTGRES_USER} + ports: + - ${POSTGRES_PORT} + redis: + image: 'redis/redis-stack:latest' + labels: + - "org.springframework.boot.service-connection=redis" + ports: + - '6379' + my-spring-app: # Spring Boot 애플리케이션 서비스 + build: . # Dockerfile을 통해 애플리케이션 이미지 빌드 + container_name: eodiroo + ports: + - '8080:8080' + environment: + - SPRING_PROFILES_ACTIVE=docker # docker 프로필 활성화 + - DATADOG_API_KEY=${DATADOG_API_KEY} # 환경 변수 주입 + - DATADOG_APPLICATION_KEY=${DATADOG_APPLICATION_KEY} # 환경 변수 주입 + # ... 기타 애플리케이션 환경 변수 ... + volumes: + - /var/app/log/eodiroo # 애플리케이션 로그를 호스트 볼륨에 마운트 (Datadog Agent가 읽을 수 있도록) + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + # APM을 위한 Datadog Java Agent 연결 (선택 사항) + # command: java -javaagent:/opt/datadog/dd-java-agent.jar -Ddd.service.name=my-spring-app -Ddd.env=local -Ddd.version=1.0.0 -jar /app/app.jar + + datadog-agent: + image: 'datadog/agent:latest' # 또는 특정 버전 + container_name: datadog-agent + environment: + - DD_API_KEY=${DATADOG_API_KEY} + - DD_SITE=${DATADOG_SITE} + - DD_APM_ENABLED=true # APM 활성화 + - DD_LOGS_ENABLED=true # 로그 수집 활성화 + - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true # 모든 컨테이너 로그 수집 + - DD_PROCESS_AGENT_ENABLED=true + - DD_CONTAINER_EXCLUDE="name:datadog-agent" # Agent 자신은 모니터링 제외 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro # Docker 소켓 마운트 (컨테이너 메타데이터 수집) + - /proc/:/host/proc/:ro # 호스트 프로세스 정보 수집 + - /sys/fs/cgroup/:/host/sys/fs/cgroup/:ro # cgroup 정보 수집 + - /var/log/my-spring-app:/var/log/my-spring-app:ro # 애플리케이션 로그 볼륨 마운트 + ports: + - '8126:8126/udp' # APM 트레이스 수신 포트 + restart: unless-stopped \ No newline at end of file From 82be70fb3c79e8a74eba1c5d829d3f15b944aa60 Mon Sep 17 00:00:00 2001 From: wonjuneee Date: Fri, 4 Jul 2025 17:55:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20jdk=20=EB=B0=B0=ED=8F=AC=ED=8C=90=20?= =?UTF-8?q?corretto=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 8 ++++---- src/test/resources/application-test.yml | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 src/test/resources/application-test.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 106f413..8d5b6f7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -26,12 +26,12 @@ jobs: uses: actions/setup-java@v4 with: java-version: '21' - distribution: 'openjdk' + distribution: 'corretto' # Use 'corretto' for Amazon Corretto JDK, or 'temurin' for Eclipse Temurin JDK # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - name: Setup Gradle - uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + uses: gradle/actions/setup-gradle@v4 # v4.0.0 - name: Build with Gradle Wrapper run: ./gradlew build @@ -59,9 +59,9 @@ jobs: uses: actions/setup-java@v4 with: java-version: '21' - distribution: 'openjdk' + distribution: 'corretto' # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + uses: gradle/actions/dependency-submission@v3 # v4.0.0 diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml new file mode 100644 index 0000000..2f294de --- /dev/null +++ b/src/test/resources/application-test.yml @@ -0,0 +1,6 @@ +# src/test/resources/application-test.yml +spring: + datasource: + url: jdbc:h2:mem:testdb + username: sa + password: \ No newline at end of file