Compare commits
42 Commits
feature/gi
...
bc58f8629e
| Author | SHA1 | Date | |
|---|---|---|---|
| bc58f8629e | |||
|
|
745c5a7461 | ||
|
|
a586ba28bd | ||
| ef4d58dfad | |||
|
|
7b47a02d9a | ||
|
|
7fb2bfdfa4 | ||
|
|
98a8159d9f | ||
| 632eaa721e | |||
| b6ab357703 | |||
| 8fca06fcbc | |||
| 53887b77ed | |||
|
|
2808bbc29d | ||
| fc1420a0ea | |||
| 80b13f2893 | |||
|
|
ea2ecf2539 | ||
| 75b5328f27 | |||
| 320e64f929 | |||
| 58d246a993 | |||
| 9eade14238 | |||
| c289eb242d | |||
| cf5503f56f | |||
| 158dc8f7a0 | |||
|
|
311aa989d3 | ||
| 4b0471639c | |||
| 18b3dc3f8c | |||
| 7351a95f80 | |||
| 4b865b2f1c | |||
| d1c22a3b3f | |||
| a7a7def41b | |||
| cfaded0543 | |||
| f70e9552c5 | |||
| e33bf89f0f | |||
| 6d9763335c | |||
| 1ebb7522dc | |||
| 676b9f76f3 | |||
| f5d5e0d5db | |||
| 02b798b01b | |||
| 2526cb0c53 | |||
| 2023107327 | |||
| a2bf6949a2 | |||
| 60eb072d7c | |||
|
|
f1e1670db7 |
@@ -2,56 +2,30 @@ name: Main-Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
branches: ["master"]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ci-maven-node:1.0
|
||||
options: >-
|
||||
--add-host nexus.sayinfo.co.kr:10.1.20.50
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "8"
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Maven Build WAR
|
||||
run: mvn -B clean package -DskipTests
|
||||
|
||||
# ------------------------------
|
||||
# 🔻 Harbor 관련 기능 임시 비활성화
|
||||
# ------------------------------
|
||||
|
||||
# - name: Docker login to Harbor
|
||||
# run: |
|
||||
# echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.sayinfo.co.kr -u ${{ secrets.HARBOR_USERNAME }} --password-stdin
|
||||
|
||||
# - name: Build Docker image
|
||||
# run: |
|
||||
# docker build -t sayit-helpdesk:latest .
|
||||
|
||||
# - name: Tag image for Harbor
|
||||
# run: |
|
||||
# docker tag sayit-helpdesk:latest harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest
|
||||
|
||||
# - name: Push image to Harbor
|
||||
# run: |
|
||||
# docker push harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest
|
||||
|
||||
# ------------------------------
|
||||
# 끝 (Harbor 비활성화)
|
||||
# ------------------------------
|
||||
|
||||
- name: Build Docker image (local only, no push)
|
||||
- name: Login Harbor
|
||||
run: |
|
||||
docker build -t sayit-helpdesk:local-test .
|
||||
printf "%s" "$HARBOR_PASSWORD" | docker login harbor.sayinfo.co.kr -u "$HARBOR_USERNAME" --password-stdin
|
||||
env:
|
||||
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
|
||||
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
|
||||
|
||||
- name: Done
|
||||
run: echo "Main branch build completed (Harbor push disabled)."
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t sayit-helpdesk:latest .
|
||||
|
||||
- name: Push to Harbor
|
||||
run: |
|
||||
docker tag sayit-helpdesk:latest harbor.sayinfo.co.kr/sayit-helpdesk-gitea_action_runner_test/helpdesk-service:latest
|
||||
docker push harbor.sayinfo.co.kr/sayit-helpdesk-gitea_action_runner_test/helpdesk-service:latest
|
||||
|
||||
@@ -2,33 +2,15 @@ name: PR-CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize] # PR 생성 + 커밋 push 때만 실행
|
||||
branches: ["master"]
|
||||
types: [opened, synchronize]
|
||||
branches: ["master"]
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ci-maven-node:1.0
|
||||
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "8"
|
||||
|
||||
- name: Cache Maven repo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: m2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
m2-${{ runner.os }}-
|
||||
|
||||
- name: Maven Build (compile + dependency check)
|
||||
- name: Maven Build (skip tests)
|
||||
run: mvn -B clean package -DskipTests
|
||||
|
||||
10
.mvn/settings.xml
Normal file
10
.mvn/settings.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<settings>
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>sayinfo-nexus</id>
|
||||
<name>Sayinfo Nexus</name>
|
||||
<url>https://nexus.sayinfo.co.kr/repository/maven-public/</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
</settings>
|
||||
45
Dockerfile
Normal file
45
Dockerfile
Normal file
@@ -0,0 +1,45 @@
|
||||
# 1단계: OTEL Java 에이전트 다운로드
|
||||
FROM alpine:3.20 AS otel
|
||||
ARG OTEL_VERSION=2.21.0
|
||||
|
||||
RUN apk add --no-cache curl && \
|
||||
curl -fL \
|
||||
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OTEL_VERSION}/opentelemetry-javaagent.jar \
|
||||
-o /opentelemetry-javaagent.jar
|
||||
|
||||
# 2단계: Tomcat 이미지 (Java 8 기준)
|
||||
FROM tomcat:9.0-jdk8-temurin
|
||||
|
||||
ENV TZ=Asia/Seoul \
|
||||
OTEL_SERVICE_NAME=helpdesk_service \
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=http://192.168.100.203:4317 \
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
|
||||
OTEL_RESOURCE_ATTRIBUTES="deployment.environment=prod" \
|
||||
JAVA_TOOL_OPTIONS="\
|
||||
-Xms1g \
|
||||
-Xmx1g \
|
||||
-XX:+UseG1GC \
|
||||
-XX:MaxGCPauseMillis=200 \
|
||||
-XX:+UnlockExperimentalVMOptions \
|
||||
-XX:+UseStringDeduplication \
|
||||
-XX:+HeapDumpOnOutOfMemoryError \
|
||||
-XX:HeapDumpPath=/tmp \
|
||||
-XX:+DisableExplicitGC \
|
||||
-javaagent:/opt/opentelemetry-javaagent.jar"
|
||||
|
||||
# 타임존 설정
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
||||
|
||||
# OTEL 에이전트 복사
|
||||
COPY --from=otel /opentelemetry-javaagent.jar /opt/opentelemetry-javaagent.jar
|
||||
RUN chown 1000:1000 /opt/opentelemetry-javaagent.jar
|
||||
|
||||
# 기본 웹앱 정리
|
||||
RUN rm -rf /usr/local/tomcat/webapps/*
|
||||
|
||||
# Maven 빌드된 WAR 복사
|
||||
COPY target/sayit-helpdesk.war /usr/local/tomcat/webapps/ROOT.war
|
||||
RUN chown -R 1000:1000 /usr/local/tomcat/
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["catalina.sh","run"]
|
||||
132
Jenkinsfile
vendored
Normal file
132
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
// Jenkinsfile — Kaniko build + K8s deploy (빌드번호 태그 사용)
|
||||
def L = 'kaniko-and-deploy'
|
||||
def REG = 'harbor.sayinfo.co.kr'
|
||||
def IMAGE = 'sayit-helpdesk/helpdesk-service' // Harbor 프로젝트/레포 이름
|
||||
def APP_NS = 'sayit-helpdesk' // 실제 K8s 네임스페이스
|
||||
def DEPLOY = 'sayit-helpdesk-service' // 실제 Deployment 이름
|
||||
def IMAGE_TAG = "${env.BUILD_NUMBER}"
|
||||
|
||||
podTemplate(
|
||||
label: L,
|
||||
yaml: """
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
spec:
|
||||
serviceAccountName: default
|
||||
securityContext:
|
||||
fsGroup: 1001
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
hostAliases:
|
||||
- ip: "192.168.0.210"
|
||||
hostnames:
|
||||
- "harbor.sayinfo.co.kr"
|
||||
- "nexus.sayinfo.co.kr"
|
||||
containers:
|
||||
- name: maven
|
||||
image: maven:3.9.9-eclipse-temurin-8
|
||||
command: ["/bin/sh","-lc"]
|
||||
args: ["sleep 99d"]
|
||||
tty: true
|
||||
volumeMounts:
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
- name: maven-cache
|
||||
mountPath: /root/.m2
|
||||
- name: kaniko
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
command: ["/busybox/sh","-c"]
|
||||
args: ["sleep 99d"]
|
||||
tty: true
|
||||
volumeMounts:
|
||||
- name: kaniko-auth
|
||||
mountPath: /kaniko/.docker
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
- name: kubectl
|
||||
image: bitnamilegacy/kubectl:latest
|
||||
command: ["/bin/sh","-lc"]
|
||||
args: ["sleep 99d"]
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
tty: true
|
||||
volumeMounts:
|
||||
- name: workspace-volume
|
||||
mountPath: /home/jenkins/agent
|
||||
volumes:
|
||||
- name: kaniko-auth
|
||||
projected:
|
||||
sources:
|
||||
- secret:
|
||||
name: regcred-sayit-helpdesk
|
||||
items:
|
||||
- key: .dockerconfigjson
|
||||
path: config.json
|
||||
- name: workspace-volume
|
||||
emptyDir: {}
|
||||
- name: maven-cache
|
||||
persistentVolumeClaim:
|
||||
claimName: maven-repo-pvc
|
||||
"""
|
||||
) {
|
||||
node(L) {
|
||||
timestamps {
|
||||
stage('Checkout') {
|
||||
checkout scm
|
||||
}
|
||||
|
||||
stage('Maven Build') {
|
||||
container('maven') {
|
||||
sh '''
|
||||
set -eux
|
||||
cd "${WORKSPACE}"
|
||||
mvn -B -q -e -T 1C -s .mvn/settings.xml clean package -DskipTests
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Preflight (Kaniko)') {
|
||||
container('kaniko') {
|
||||
sh '''
|
||||
set -eux
|
||||
cd "${WORKSPACE}"
|
||||
test -f /kaniko/.docker/config.json
|
||||
nslookup harbor.sayinfo.co.kr || true
|
||||
grep harbor /etc/hosts || true
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build & Push (Kaniko)') {
|
||||
container('kaniko') {
|
||||
sh """
|
||||
set -eux
|
||||
cd "\${WORKSPACE}"
|
||||
/kaniko/executor \\
|
||||
--context=. \\
|
||||
--dockerfile=Dockerfile \\
|
||||
--destination=${REG}/${IMAGE}:${IMAGE_TAG} \\
|
||||
--snapshot-mode=redo \\
|
||||
--skip-tls-verify \\
|
||||
--cache=true \\
|
||||
--cache-repo=${REG}/sayit-helpdesk/build-cache
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to Kubernetes') {
|
||||
container('kubectl') {
|
||||
sh """
|
||||
set -eux
|
||||
kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG}
|
||||
kubectl -n ${APP_NS} rollout status deploy/${DEPLOY} --timeout=300s
|
||||
|
||||
kubectl -n ${APP_NS} get deploy ${DEPLOY} -o wide
|
||||
kubectl -n ${APP_NS} get pods -l app=${DEPLOY} -o wide
|
||||
kubectl -n ${APP_NS} get pod -l app=${DEPLOY} -o jsonpath='{.items[*].spec.containers[*].image}'; echo
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,9 @@ public class AuthenticInterceptor extends HandlerInterceptorAdapter {
|
||||
uri.equals("/") ||
|
||||
uri.equals("/actionLoginSys.do") ||
|
||||
uri.equals("/js/") ||
|
||||
uri.equals("/images/")
|
||||
uri.equals("/images/") ||
|
||||
uri.equals("/health.do")
|
||||
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.io.IOException;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
public class MainController {
|
||||
@@ -88,5 +90,12 @@ public class MainController {
|
||||
}
|
||||
return startPage;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/health.do", method = RequestMethod.GET)
|
||||
public void health(HttpServletResponse response) throws IOException {
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.setContentType("text/plain;charset=UTF-8");
|
||||
response.getWriter().write("OK");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<security:http pattern="/js/**" security="none"/>
|
||||
<security:http pattern="/resource/**" security="none"/>
|
||||
<security:http pattern="\A/WEB-INF/jsp/.*\Z" request-matcher="regex" security="none"/>
|
||||
<security:http pattern="/health.do" security="none"/>
|
||||
|
||||
<egov-security:config id="securityConfig"
|
||||
loginUrl="/login.do"
|
||||
|
||||
BIN
src/main/webapp/Favicon.ico
Normal file
BIN
src/main/webapp/Favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -17,6 +17,7 @@
|
||||
<script src="js/common/login.js"></script>
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<style>
|
||||
.login_wrap_body{ background:url(${pageContext.request.contextPath}/images/admin/login_bg.gif) repeat left top; font-family:"맑은 고딕",Malgun Gothic,AppleGothic,sans-serif,"돋움", Dotum; }
|
||||
.login_wrap{display:block; height:100%; left:0; position:fixed; top:0; width:100%; z-index:10000;}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<meta name="keywords" content="" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = '${pageContext.request.contextPath}';</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
@@ -22,6 +22,7 @@ if(UserHelper.isAuthenticated()) {
|
||||
<meta name="keywords" content="" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = '${pageContext.request.contextPath}';</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
@@ -23,6 +23,7 @@ if(UserHelper.isAuthenticated()) {
|
||||
<meta name="keywords" content="" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = '${pageContext.request.contextPath}';</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
@@ -22,6 +22,7 @@ if(UserHelper.isAuthenticated()) {
|
||||
<meta name="keywords" content="" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = '${pageContext.request.contextPath}';</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<meta name="keywords" content="noframe" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = "${pageContext.request.contextPath}";</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
@@ -22,6 +22,7 @@ if(UserHelper.isAuthenticated()) {
|
||||
<meta name="keywords" content="" />
|
||||
<base target="_self" />
|
||||
<title><%=MainGlobals.SITE_TITLE%></title>
|
||||
<link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/Favicon.ico?v=20251209" />
|
||||
<script type="text/javascript">var G_CONTEXT_PATH = '${pageContext.request.contextPath}';</script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user