Skip to content

Comments

Ci: CI/CD GH Actions ➡️ Jenkins 변경 / #132#133

Open
JayongLee wants to merge 2 commits intomainfrom
ci/#132
Open

Ci: CI/CD GH Actions ➡️ Jenkins 변경 / #132#133
JayongLee wants to merge 2 commits intomainfrom
ci/#132

Conversation

@JayongLee
Copy link
Member

@JayongLee JayongLee commented Jan 25, 2026

🗞️ 연관된 이슈

🔥 이슈번호

✅ 작업 내용

  • CI/CD GH Actions ➡️ Jenkins 변경

📸 스크린샷 (선택)

체크리스트 ✅

  • 코드가 정상적으로 컴파일되나요?
  • merge할 브랜치의 위치를 확인했나요?
  • 테스트 코드를 작성하셨나요?

기타

@JayongLee JayongLee self-assigned this Jan 25, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @JayongLee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 프로젝트의 CI/CD 워크플로우를 GitHub Actions에서 Jenkins로 마이그레이션하는 것을 목표로 합니다. 새로운 Jenkins 파이프라인은 코드 체크아웃부터 빌드, SonarQube를 통한 코드 품질 분석, 품질 게이트 검증, Docker Compose를 이용한 자동 배포, 그리고 배포된 애플리케이션의 헬스 체크까지 전반적인 개발 및 배포 과정을 자동화하여 효율성을 높이고 안정적인 배포 환경을 구축합니다.

Highlights

  • CI/CD 시스템 변경: 기존 GitHub Actions에서 Jenkins 기반 CI/CD 파이프라인으로 전환되었습니다.
  • Jenkinsfile 추가: 프로젝트 루트에 Jenkinsfile이 새로 추가되어 빌드, 테스트, 코드 품질 분석, 배포 및 헬스 체크 과정을 정의합니다.
  • 자동화된 빌드 및 SonarQube 분석: Gradle을 사용하여 애플리케이션을 빌드하고, SonarQube를 통해 코드 품질을 자동으로 분석합니다.
  • 품질 게이트 적용: SonarQube 품질 게이트를 통과하지 못할 경우 파이프라인이 중단되도록 설정되었습니다.
  • Docker Compose 기반 배포: main 브랜치에 대한 변경 사항은 docker compose를 사용하여 /opt/docker/creditto 경로에 자동으로 배포됩니다.
  • 배포 후 헬스 체크: 배포 완료 후, 애플리케이션의 정상 작동 여부를 확인하기 위한 헬스 체크 단계가 포함되었습니다.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/CD.yml
    • .github/workflows/CI.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. Jenkins를 이용한 CI/CD 파이프라인으로 전환하는 작업을 리뷰했습니다. 전체적으로 Jenkinsfile의 구조가 잘 잡혀있고, 각 스테이지의 역할이 명확하게 분리되어 있어 이해하기 좋습니다. 몇 가지 개선점을 제안드립니다.

주요 제안 내용은 다음과 같습니다:

  • docker compose pullcurl 명령어에서 || true를 사용하여 오류를 무시하는 부분을 수정하여 파이프라인의 안정성을 높였습니다.
  • Health check 스크립트의 루프 구문을 이식성이 더 좋은 방식으로 변경했습니다.
  • 파이프라인의 유연성과 재사용성을 높이기 위해 하드코딩된 환경 변수들을 파라미터화하는 것을 제안했습니다.

자세한 내용은 각 코드 라인에 남긴 코멘트를 확인해주세요. 좋은 작업 감사합니다!

printf "%s" "$ENV_CONTENT" > .env
chmod 600 .env

docker compose -f "${COMPOSE_FILE}" pull || true

Choose a reason for hiding this comment

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

high

docker compose pull 명령어에 || true를 사용하면 이미지 pull에 실패하더라도 파이프라인이 중단되지 않아 잠재적인 오류를 파악하기 어려울 수 있습니다. 예를 들어, 외부 의존성이 있는 이미지를 pull하지 못하면 서비스가 정상적으로 동작하지 않을 수 있습니다. 이미지 pull 실패 시 파이프라인을 중단시켜 문제를 즉시 인지할 수 있도록 || true를 제거하는 것을 권장합니다.

            docker compose -f "${COMPOSE_FILE}" pull

Comment on lines +111 to +119
for i in $(seq 1 10); do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "${HEALTH_URL}" || true)
if [ "$STATUS" = "200" ]; then
echo "✅ 서버 정상 응답 (HTTP 200)"
exit 0
fi
echo "⏳ 서버 기동 대기중... ($i/10) status=$STATUS"
sleep 5
done

Choose a reason for hiding this comment

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

high

Health check 스크립트에 두 가지 개선점을 제안합니다.

  1. curl 명령어의 || true 제거: set -e 옵션과 함께 || true를 사용하면 curl 명령 자체가 실패하는 경우(예: 네트워크 오류)에도 스크립트가 중단되지 않습니다. 이 경우 STATUS 변수가 비어있게 되어 의도치 않은 동작을 유발할 수 있습니다. || true를 제거하여 curl 실패 시 즉시 파이프라인이 실패하도록 하는 것이 더 안전합니다.
  2. 이식성 높은 루프 사용: for i in $(seq 1 10) 구문은 seq 명령어가 없는 환경에서는 동작하지 않을 수 있습니다. 더 넓은 호환성을 위해 POSIX 표준 while 루프를 사용하는 것이 좋습니다.
          i=1
          while [ $i -le 10 ]; do
            STATUS=$(curl -s -o /dev/null -w "%{\http_code}" "${HEALTH_URL}")
            if [ "$STATUS" = "200" ]; then
              echo "✅ 서버 정상 응답 (HTTP 200)"
              exit 0
            fi
            echo "⏳ 서버 기동 대기중... ($i/10) status=$STATUS"
            sleep 5
            i=$((i+1))
          done

Comment on lines +11 to +14
COMPOSE_DIR = '/opt/docker/creditto'
COMPOSE_FILE = 'docker-compose.yml'
HEALTH_URL = 'http://creditto:8080/health'
SPRING_PROFILE = 'dev'

Choose a reason for hiding this comment

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

medium

COMPOSE_DIR, COMPOSE_FILE, HEALTH_URL, SPRING_PROFILE과 같은 환경 변수들이 하드코딩되어 있습니다. 이는 파이프라인의 유연성과 재사용성을 저해할 수 있습니다. 예를 들어, 다른 환경(staging, production)이나 다른 서버에서 이 파이프라인을 실행해야 할 경우, Jenkinsfile을 직접 수정해야 합니다. 이러한 값들은 Jenkins 파이프라인의 파라미터로 정의하거나, Jenkins의 'Manage Jenkins -> Configure System'에서 전역 변수로 설정하여 관리하는 것이 더 좋은 방법입니다. 이렇게 하면 파이프라인 코드 변경 없이 설정을 쉽게 변경할 수 있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant