CI-CD
QuickBuild 빌드 예제
자바바라
2025. 7. 11. 06:41
QuickBuild(v15) + Nexus + GitLab + Harbor + K8s 연동하여 CI/CD 파이프라인을 구성하는 3가지 대표 예제,
QuickBuild에서 사용할 설정, Jenkins/Helm/Kubectl/Ansible 등을 이용한 배포 방식.
QuickBuild 서버에서 선행 필요
| Agent 등록 | Linux 환경에 QuickBuild Agent 설치 후 등록 (ex: /opt/qb-agent) |
| GitLab | 코드 저장소 (Spring Boot, Node.js, Nginx 등 예제에 따라 다름) |
| Nexus | Maven repository (예: .jar 아티팩트 저장) |
| Harbor | Docker Image Registry |
| Kubernetes | 배포 대상 클러스터 준비 (kubectl 가능해야 함) |
| Docker/Kubectl | QB Agent에 설치되어 있어야 함 |
예제 1. Spring Boot 앱 → GitLab → Nexus → K8s 배포
목적:
Spring Boot 프로젝트를 GitLab에서 가져와 Maven 빌드 후 .jar 파일을 Nexus에 업로드하고, 이를 기반으로 Docker 이미지를 빌드하고 Kubernetes에 배포
1단계: Agent 등록
- 메뉴: Administration → Agents
- 우측 상단 "Add" 클릭
- 예시:
- Name: agent-01
- Host: 192.168.56.101
- Capabilities:
- os=linux
- docker=true
- kubernetes=true
2단계: Configuration 생성
- 메뉴: Configurations → New Configuration
- 이름: springboot-nexus-k8s
- Parent: /root
- Build Steps:
- Git Clone
- Repository: https://gitlab.example.com/dev/springboot-app.git
- Credential 등록 (SSH Key 또는 Username/Token)
- Maven Build
- Command: mvn clean package -DskipTests
- Artifacts: target/*.jar → 저장
- Nexus Upload
- URL: http://nexus.example.com/repository/maven-releases/
- 파일 업로드 경로: target/*.jar
- Docker Build
- Dockerfile: Dockerfile (기본 경로)
- Image name: harbor.example.com/dev/springboot:latest
- Harbor Push
- Docker login → docker login harbor.example.com
- docker push harbor.example.com/dev/springboot:latest
- Kubernetes 배포
- Shell Script Step:
- kubectl set image deployment/springboot-deployment springboot=harbor.example.com/dev/springboot:latest --namespace=dev
- Git Clone
예제 2. Node.js 앱 → GitLab → Harbor (Docker) → K8s 배포
목적:
Node.js 프로젝트를 Docker 이미지로 빌드해서 Harbor에 푸시하고 Kubernetes에 배포
Configuration: nodejs-harbor-k8s
- Build Steps:
- GitLab Clone
- Docker Build
- Image: harbor.example.com/dev/nodejs:latest
- FROM node:18 WORKDIR /app COPY . . RUN npm install CMD ["node", "index.js"]
- Harbor Push
- docker push harbor.example.com/dev/nodejs:latest
- K8s 배포
- kubectl apply -f k8s/deployment.yaml
예제 3. 정적 웹사이트 (Nginx) → GitLab → Harbor → K8s
목적:
정적 HTML 사이트를 Nginx 이미지로 만들어 Harbor에 푸시 후 K8s에 배포
Configuration: nginx-static-harbor-k8s
- GitLab: https://gitlab.example.com/dev/static-site.git
- Dockerfile:
- FROM nginx:alpine COPY . /usr/share/nginx/html
- Steps:
- Git Clone
- Docker Build: harbor.example.com/dev/static-site:latest
- Harbor Push
- K8s 배포:
- kubectl rollout restart deployment nginx-static --namespace=web
Configuration 공통 설정 요약
설정 값
| Repository | GitLab (OAuth/SSH 등록 필요) |
| Build Agent | agent-01 지정 |
| Trigger | GitLab Webhook 또는 일정 트리거 |
| Artifact | Nexus 또는 Docker Image |
| Deployment | Kubernetes YAML 또는 kubectl set image |
QuickBuild UI 메뉴 위치
작업 메뉴 경로
| Agent 등록 | Administration → Agents |
| Configuration 생성 | Configurations → "+" 버튼 |
| Build Logs 확인 | Configuration → Build → Steps 탭 |
| Credential 설정 | Administration → Authentication → Credential |
| Git/Webhook 설정 | Configuration → General → Repository |
| Step 추가 | Configuration → Build Steps 탭 → Add Step |
QuickBuild 최신 버전에서 기본 화면에 root 항목만 보이고, 구성(프로젝트/Configuration) 추가 버튼이 안 보이는 현상은 관리자 권한이나 UI 정책 변경 때문일 수 있다. 실제로 최신 QuickBuild에서는 다음과 같은 특징이 있다:
- 최초 로그인 시 root만 보임: 아무런 프로젝트나 configuration이 없는 상태에서는 트리 구조의 최상단에 root만 표시됩니다.
- 구성 추가(프로젝트/Configuration 추가) 버튼이 안 보임:
- 관리자 권한이 없거나,
- UI 정책이 변경되어 기본적으로 "추가" 버튼이 숨겨져 있을 수 있다.
- 구성 추가 방법:
- 일반적으로 root 항목(또는 프로젝트 우측 상단)에 마우스를 올리면 ‘+’ 또는 메뉴 버튼이 나타나고, 거기서 "New Configuration" 또는 "New Project"를 선택할 수 있다.
- 만약 버튼이 아예 보이지 않는다면, 관리자 권한이 있는지 확인하거나, QuickBuild 관리 메뉴에서 권한 설정을 점검해야 한다.
즉, 최신 버전에서는 예전처럼 항상 "구성 추가" 버튼이 보이지 않고, 권한이나 UI 정책에 따라 보이는 위치와 방식이 달라질 수 있다.
관리자 권한이 있다면 root 항목 우측이나 context 메뉴(오른쪽 클릭)에서 추가 메뉴를 찾아.
(검색 결과에는 직접적인 QuickBuild UI 변경 사례는 없으나, 소프트웨어 업그레이드 후 표준 작업 흐름이나 UI가 바뀔 수 있다는 점은 일반적인 현상)