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
14 changes: 0 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE/standard.md

This file was deleted.

83 changes: 58 additions & 25 deletions .github/workflows/ci-prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
SPRING_PROFILES_ACTIVE: test
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
token: ${{ secrets.PAT }}
Expand All @@ -25,7 +25,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v5

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -34,46 +34,79 @@ jobs:
run: ./gradlew clean build --info --stacktrace --no-daemon

- name: Docker login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Set image tag
id: vars
run: echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Build Docker image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }} -f deploy/Dockerfile .

- name: Docker Hub push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }}
# Multi-architecture 빌드 및 푸시
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
platforms: linux/amd64,linux/arm64 # 두 아키텍처 모두 빌드
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
Comment on lines +52 to +62
Copy link

@coderabbitai coderabbitai bot Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== 디렉토리 구조 확인 ==="
ls -la deploy/ 2>/dev/null || echo "deploy 디렉토리 없음"

echo -e "\n=== Dockerfile 내용 ==="
cat deploy/Dockerfile 2>/dev/null || echo "Dockerfile 없음"

echo -e "\n=== Gradle 파일 목록 ==="
fd -type f -name "build.gradle*" 2>/dev/null

echo -e "\n=== build.gradle 파일 확인 ==="
cat build.gradle 2>/dev/null || cat build.gradle.kts 2>/dev/null || echo "build.gradle 파일 없음"

echo -e "\n=== 네이티브 라이브러리 의존성 검색 ==="
if [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
  rg -i "native|jni|jna|netty-transport-native|ojdbc|oracle|postgresql|mysql|h2" build.gradle* -C 2 || echo "해당 의존성 없음"
fi

Repository: StartUpLight/STARLIGHT_BE

Length of output: 1380


🏁 Script executed:

#!/bin/bash

echo "=== Gradle 모듈 파일 확인 ==="
ls -la gradle/

echo -e "\n=== database.gradle (DB 드라이버) ==="
cat gradle/database.gradle

echo -e "\n=== spring.gradle (Spring 의존성) ==="
cat gradle/spring.gradle

echo -e "\n=== 기타 gradle 파일들 ==="
for file in gradle/config.gradle gradle/jwt.gradle gradle/util.gradle gradle/ai.gradle; do
  if [ -f "$file" ]; then
    echo "=== $file ==="
    cat "$file"
  fi
done

echo -e "\n=== JRE Alpine base image 아키텍처 지원 확인 ==="
echo "eclipse-temurin:21-jre-alpine는 DockerHub에서 linux/amd64, linux/arm64 모두 지원합니다 (공식 문서 확인 필요)"

Repository: StartUpLight/STARLIGHT_BE

Length of output: 3833


🌐 Web query:

eclipse-temurin 21 jre alpine multi-architecture support amd64 arm64

💡 Result:

Short answer: The official eclipse-temurin repository publishes multi‑arch images (including amd64 and arm64), but the alpine variant tags (e.g. 21-jre-alpine / -jdk-alpine) have historically been published only for amd64 — so an out‑of‑the‑box linux/arm64 manifest for 21-jre-alpine is often not available. [1][2][3]

What to do

  • Use the non‑Alpine Temurin 21 runtime tag (e.g. eclipse-temurin:21-jre) — that tag is published as a multi‑arch manifest including linux/arm64 and linux/amd64. [1][3]
  • If you need Alpine/musl: build a multi‑arch alpine image yourself (multi‑arch build or buildx) or use a vendor that provides arm64 Alpine JRE builds (or use a slim Debian/Ubuntu variant as an alternative). Community issues and Q&A note users must build the alpine variant for ARM when the upstream tag lacks an arm64 manifest. [2][4]

Sources

  1. Eclipse Temurin Docker Hub (supported architectures & variant notes). [Docker Hub]. [1]
  2. adoptium/containers GitHub issue and community reports about -alpine not having ARM manifests. [2]
  3. StackOverflow examples reporting "no matching manifest for linux/arm64/v8" for -alpine and recommending non‑alpine multi‑arch tags. [3]

Would you like me to check the current manifest for a specific tag (e.g. inspect eclipse-temurin:21-jre-alpine manifest now) and return exact platforms?


❌ Dockerfile의 베이스 이미지가 ARM64 멀티아키텍처 빌드를 지원하지 않습니다 - 즉시 수정 필요

CI/CD 파이프라인이 현재 설정 그대로 실행되면 linux/arm64 빌드에서 실패합니다.

문제점:
eclipse-temurin:21-jre-alpineamd64 아키텍처만 지원합니다. docker/build-push-action이 arm64 이미지를 빌드하려 할 때 "no matching manifest for linux/arm64/v8" 에러가 발생합니다.

해결 방법:
deploy/Dockerfile의 런타임 베이스 이미지를 다음과 같이 변경하세요:

Dockerfile 수정 사항
  # 빌드 단계
  FROM eclipse-temurin:21-jdk AS builder
  WORKDIR /app
  COPY . .
  RUN ./gradlew build -x test

  # 실행 단계
- FROM eclipse-temurin:21-jre-alpine AS runtime
+ FROM eclipse-temurin:21-jre AS runtime
  WORKDIR /app
  COPY --from=builder /app/build/libs/*.jar app.jar
  EXPOSE 8080
  ENTRYPOINT ["java", "-jar", "app.jar"]

eclipse-temurin:21-jre (non-Alpine)는 amd64와 arm64 모두에서 공식 지원되며, 이미지 크기 차이도 무시할 수 있는 수준입니다. 멀티아키텍처 빌드가 성공적으로 실행될 수 있도록 이 변경을 먼저 적용하세요.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/ci-prd.yaml around lines 52-62 the workflow triggers a
multi-arch build (linux/amd64, linux/arm64) but your deploy/Dockerfile uses an
Alpine Temurin base that only supports amd64; open deploy/Dockerfile and replace
the Alpine runtime base (e.g., FROM eclipse-temurin:21-jre-alpine) with a
multi-arch-supported image such as FROM eclipse-temurin:21-jre, then adjust any
Alpine-specific commands (apk add, musl-specific tweaks) to Debian/Ubuntu
equivalents (apt-get install, dpkg paths) or remove them so the Dockerfile is
compatible with the non-Alpine base, and re-run the CI multi-arch build to
verify arm64 succeeds.

Copy link
Contributor Author

@SeongHo5356 SeongHo5356 Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스테이징 서버로 검증했는데 멀티 아키텍쳐로 잘 빌드 되고 있고, 현재 액션도 성공한 걸로 보인다.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== Current deploy/Dockerfile content ==="
cat deploy/Dockerfile

echo -e "\n=== Checking staging workflow for differences ==="
cat .github/workflows/ci-stg.yaml | grep -A 10 "docker/build-push-action"

echo -e "\n=== Checking for recent Dockerfile changes in git history ==="
git log --oneline --all -10 -- deploy/Dockerfile

Length of output: 892


🌐 Web query:

eclipse-temurin 21-jre-alpine ARM64 support 2025

💡 Result:

Short answer: Yes — as of Dec 31, 2025 the official eclipse-temurin:21-jre-alpine images are published for ARM64 (linux/arm64 / arm64v8). See the Docker Hub supported architectures and the Adoptium release notes about Alpine images. [1][2]

Sources

  • Docker Hub eclipse-temurin (supported architectures: amd64, arm32v7, arm64v8, …). [1]
  • Adoptium release notes (Alpine images / Alpine 3.22 default for Temurin container images). [2]

@SeongHo5356, 스테이징 검증 결과를 확인해주셔서 감사합니다! 👍

확인 결과, 제가 제시한 우려는 더 이상 유효하지 않습니다. eclipse-temurin:21-jre-alpine 이미지가 이제 ARM64 아키텍처를 공식 지원하고 있어서, 현재 Dockerfile 설정 그대로 멀티 아키텍처 빌드가 정상적으로 작동합니다.

스테이징 서버에서의 실제 검증이 이를 확인해주었네요. 현재 설정으로 프로덕션 배포도 문제없이 진행하실 수 있습니다. 실제 테스트를 통해 확인해주셔서 감사합니다! 🚀


- name: Checkout manifest repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: 'StartUpLight/STARLIGHT_MANIFEST'
token: ${{ secrets.PAT }}
path: 'manifest'

- name: Update deployment.yml
- name: Update deployment.yml and push manifest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" manifest/production/deployment.yml

# 변경사항 확인
echo "Updated deployment.yml:"
cat manifest/production/deployment.yml
update_manifest() {
local dir="$1"
local file="$dir/production/deployment.yml"

- name: Commit and push changes
env:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
cd manifest
git config --local user.email "[email protected]"
git config --local user.name "SeongHo5356"
git add production/deployment.yml
git commit -m "Update image tag to $IMAGE_TAG" || exit 0
git push
sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" "$file"
echo "Updated $file:"
cat "$file"

git -C "$dir" config --local user.email "[email protected]"
git -C "$dir" config --local user.name "SeongHo5356"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email과 user name은 secrets로 관리해주는게 좋을 것 같습니다!!

Copy link
Contributor Author

@SeongHo5356 SeongHo5356 Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

username/email은 수정될 일이 거의 없고, 민감정보라기보다는 단순 커밋 메타데이터라서 공개로 둬도 괜찮을 것 같다!

git -C "$dir" add production/deployment.yml

if [ -z "$(git -C "$dir" status --porcelain)" ]; then
echo "No changes to commit in $dir"
return 0
fi

git -C "$dir" commit -m "Update image tag to $IMAGE_TAG"

for i in {1..3}; do
echo "Push attempt $i for $dir"
git -C "$dir" pull --rebase origin main && \
git -C "$dir" push && \
echo "Successfully pushed $dir" && \
break || {
echo "Push failed for $dir, retrying in 2 seconds..."
sleep 2
}
done

if ! git -C "$dir" diff --quiet origin/main HEAD; then
echo "ERROR: Failed to push $dir after 3 attempts"
return 1
fi
}

update_manifest manifest
81 changes: 55 additions & 26 deletions .github/workflows/ci-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
SPRING_PROFILES_ACTIVE: test
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
token: ${{ secrets.PAT }}
Expand All @@ -25,33 +25,33 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v5
Copy link

@coderabbitai coderabbitai bot Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

gradle/actions/setup-gradle v5 changelog breaking changes migration from v3

💡 Result:

Summary of v5 changes and migration notes (from v3)

Key breaking change in v5

  • setup-gradle@v5 upgrades its Node runtime to Node 24 — runners must support Node 24 (GitHub Actions runner v2.327.1 or newer). [1]

Other notable changes (upgrade guidance)

  • The action now performs wrapper validation by default (started in v4); workflows that relied on skipping wrapper checks should ensure the repo’s Gradle wrapper files/checksums are correct or use the separate wrapper-validation action if needed. [2]
  • The repository follows semantic versioning and documents deprecations — deprecated inputs/behaviours that existed in earlier majors may have been removed in v5; check deprecation warnings in your workflows and the project’s deprecation/upgrade guide. [3]

Migration steps from gradle/gradle-build-action@v3 -> gradle/actions/setup-gradle@v5

  1. Update workflow usage:
    • Replace uses: gradle/gradle-build-action@v3 with uses: gradle/actions/setup-gradle@v5. [4]
  2. Ensure runner compatibility:
    • Verify your GitHub-hosted or self-hosted runner is updated to a version that includes Node 24 (see runner v2.327.1+). If self-hosted, upgrade the runner software. [1]
  3. Validate Gradle Wrapper:
    • Ensure gradle-wrapper.jar and wrapper checksums in repo are valid; v5 does wrapper validation on each run. Run ./gradlew wrapper or wrapper-validation action to fix/verify if needed. [2]
  4. Run workflows and fix any deprecation errors:
    • Run CI; address any deprecation warnings or removed inputs as directed by the action logs and the upgrade/deprecation guide. [3]

Sources
[1] gradle/actions release v5.0.0 (release notes: Node 24 breaking change).
[2] gradle/actions README / docs (setup-gradle description; wrapper-validation behaviour).
[3] Gradle Actions deprecation & upgrade guide.
[4] gradle/gradle-build-action README & releases (v3 delegation to setup-gradle).

Would you like me to fetch the exact runner release note (v2.327.1) and include the GitHub Actions runner release link and exact CLI commands to update a self-hosted runner?


🌐 Web query:

gradle/actions/setup-gradle v5 Java 21 compatibility

💡 Result:

Short answer: gradle/actions/setup-gradle@v5 is compatible with Java 21 — but what matters is the Gradle version it installs and the JDK you set up.

  • setup-gradle@v5 can install a specific Gradle version (via the gradle-version input) or use the wrapper; it does not itself provide a JDK. Use actions/setup-java to install JDK 21 in your job. [1][2]

  • Gradle support for Java 21:

    • Gradle 8.4 can compile/test for Java 21 using Java toolchains (but Gradle itself may not run on JDK 21).
    • Full support to run Gradle on Java 21 was added in Gradle 8.5+. [3][4]

Recommendation: in your workflow install JDK 21 (actions/setup-java@v4/5) and either:

  • use the Gradle wrapper configured to Gradle 8.5+ (or set gradle-version: '8.5'+'') so Gradle can run on JDK21; or
  • keep the wrapper version lower but configure toolchains in your build to compile/test with Java 21. [1][3][4]

Sources:

  1. gradle/actions setup-gradle docs (inputs, gradle-version, wrapper usage). [1]
  2. Gradle GitHub Actions docs / community pages (setup-gradle caching & examples). [2]
  3. Gradle compatibility / release notes: Java 21 toolchain support (8.4) and full run support in 8.5+. [3][4]

gradle/actions/setup-gradle@v5로 업그레이드 시 다음 세 가지를 반드시 확인하세요

v3에서 v5로의 메이저 버전 업그레이드는 다음과 같은 주의사항이 있습니다:

  1. GitHub Actions 실행 환경: setup-gradle@v5는 Node 24를 요구하므로, GitHub Actions 러너가 v2.327.1 이상으로 업데이트되어야 합니다.

  2. Gradle Wrapper 검증: v4부터 Wrapper 검증이 기본 활성화되어 있습니다. gradle-wrapper.jar과 체크섬이 정상인지 확인하고, 필요 시 ./gradlew wrapper 명령으로 재생성하세요.

  3. Java 21 호환성: Java 21에서 Gradle을 완전히 실행하려면 Gradle 8.5 이상이 필요합니다. 프로젝트의 Gradle Wrapper 버전을 확인하고 필요시 업그레이드하세요.

🤖 Prompt for AI Agents
.github/workflows/ci-stg.yaml around line 28: upgrading to
gradle/actions/setup-gradle@v5 requires three checks before merging — update the
GitHub Actions runner to v2.327.1+ (or specify a hosted runner image that meets
this) so Node 24 is supported; verify the gradle-wrapper.jar and its checksum
(or regenerate with ./gradlew wrapper) since wrapper validation is enabled by
default in v4+; and ensure the project Gradle Wrapper is >= 8.5 (upgrade the
wrapper if necessary) so Java 21 builds succeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. GitHub-hosted runner를 사용중이라서, 최신버전(v2.327.1 이상)을 만족하고 있어
  2. GitHub‑hosted runner는 격리된 환경이라 런타임에서 바꿔치기될 가능성이 낮아서 gradle-wrapper.jar가 변조됐는지까지 점검할 필요는 없을 것 같아
  3. 현재 gradle-8.14.3라서 호환성에는 문제가 없는 걸로 확인했어

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeongHo5356, 세 가지 체크포인트를 모두 확인해주셔서 감사합니다!

  1. GitHub-hosted runner: 최신 이미지가 Node 24를 지원하므로 문제없습니다.
  2. Wrapper 검증: GitHub-hosted runner의 격리된 환경 특성상 변조 위험이 낮다는 판단이 합리적입니다.
  3. Gradle 8.14.3: Java 21 완전 지원(8.5+)을 훨씬 상회하는 버전이므로 호환성 문제가 없습니다.

모든 전제 조건이 충족되었으니 v5로 안전하게 업그레이드할 수 있습니다. 🚀


- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle Wrapper
run: ./gradlew clean build --info --stacktrace --no-daemon

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Set image tag
id: vars
run: echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV

# Multi-architecture 빌드 및 푸시
- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
Expand All @@ -62,30 +62,59 @@ jobs:
cache-to: type=gha,mode=max

- name: Checkout manifest repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: 'StartUpLight/STARLIGHT_MANIFEST'
token: ${{ secrets.PAT }}
path: 'manifest'

- name: Update deployment.yml
- name: Checkout manifest repository (oracle)
uses: actions/checkout@v6
with:
repository: 'StartUpLight/STARLIGHT_MANIFEST_ORACLE'
token: ${{ secrets.PAT }}
path: 'manifest-oracle'

- name: Update deployment.yml and push manifests
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" manifest/staging/deployment.yml

# 변경사항 확인
echo "Updated deployment.yml:"
cat manifest/staging/deployment.yml
update_manifest() {
local dir="$1"
local file="$dir/staging/deployment.yml"

- name: Commit and push changes
env:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
cd manifest
git config --local user.email "[email protected]"
git config --local user.name "SeongHo5356"
git add staging/deployment.yml
git commit -m "Update image tag to $IMAGE_TAG" || exit 0
git push
sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" "$file"
echo "Updated $file:"
cat "$file"

git -C "$dir" config --local user.email "[email protected]"
git -C "$dir" config --local user.name "SeongHo5356"
git -C "$dir" add staging/deployment.yml

if [ -z "$(git -C "$dir" status --porcelain)" ]; then
echo "No changes to commit in $dir"
return 0
fi

git -C "$dir" commit -m "Update image tag to $IMAGE_TAG"

for i in {1..3}; do
echo "Push attempt $i for $dir"
git -C "$dir" pull --rebase origin main && \
git -C "$dir" push && \
echo "Successfully pushed $dir" && \
break || {
echo "Push failed for $dir, retrying in 2 seconds..."
sleep 2
}
done

if ! git -C "$dir" diff --quiet origin/main HEAD; then
echo "ERROR: Failed to push $dir after 3 attempts"
return 1
fi
}

update_manifest manifest
update_manifest manifest-oracle
2 changes: 1 addition & 1 deletion config