From 0a5300044891966060d53c880fbe092ddc6fa898 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Wed, 10 Sep 2025 16:11:59 +0900 Subject: [PATCH] =?UTF-8?q?jenkins=20pipeline=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kjb-docs/Jenkinsfile | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/kjb-docs/Jenkinsfile b/kjb-docs/Jenkinsfile index e69de29..e785c36 100644 --- a/kjb-docs/Jenkinsfile +++ b/kjb-docs/Jenkinsfile @@ -0,0 +1,80 @@ +pipeline { + agent { label 'apipod01' } + + environment { + // Java 환경 설정 + JAVA_HOME = '/App/jenkins/jdks/jdk1.8.0_441' + PATH = "${JAVA_HOME}/bin:${env.PATH}" + + // Gradle 환경 설정 + GRADLE_HOME = '/App/jenkins/gradle-8.7' + GRADLE_USER_HOME = '/App/jenkins/gradle-home' + // GRADLE_OPTS = '--offline' + + // Git 저장소 정보 + GIT_SERVER = '192.168.240.178:18081' + GIT_CREDENTIALS_ID = 'git-ssh-credentials' + + // 프로젝트 디렉토리 구조 + PROJECT_HOME = '/Data/jenkins/eapim' + + BRANCH = 'staging' + } + + + stages { + stage('Git pull') { + steps { + echo "[portal] Git pull from branch: ${BRANCH}" + dir("${PROJECT_HOME}/eapim-portal") { + git url: "ssh://git@${GIT_SERVER}/eapim/eapim-portal", branch: "${BRANCH}", credentialsId: "${GIT_CREDENTIALS_ID}" + } + + + echo "[online-core-jpa] Git pull from branch: ${BRANCH}" + dir("${PROJECT_HOME}/eapim-online/elink-online-core-jpa") { + git url: "ssh://git@${GIT_SERVER}/eapim/elink-online-core-jpa", branch: "${BRANCH}", credentialsId: "${GIT_CREDENTIALS_ID}" + } + + + echo "[portal-common] Git pull from branch: ${BRANCH}" + dir("${PROJECT_HOME}/elink-portal-common") { + git url: "ssh://git@${GIT_SERVER}/eapim/elink-portal-common", branch: "${BRANCH}", credentialsId: "${GIT_CREDENTIALS_ID}" + } + } + } + + + stage('Build') { + steps { + tool name: 'Oracle-JDK-1.8', type: 'hudson.model.JDK' + // tool name: 'Gradle-8.7', type: 'hudson.tasks.Gradle' + + // echo "[online-core-jpa] Build project" + // dir("${PROJECT_HOME}/elink-online-multi/elink-online-core-jpa") { + // sh '${GRADLE_HOME}/bin/gradle clean build -x test' + // } + + // echo "[portal-common] Build project" + // dir("${PROJECT_HOME}/elink-portal-common") { + // sh '${GRADLE_HOME}/bin/gradle clean build -x test' + // } + + echo "[portal] Build project" + dir("${PROJECT_HOME}/eapim-portal") { + sh '${GRADLE_HOME}/bin/gradle clean build -x test' + } + } + } + + + stage('Archive WAR') { + steps { + echo "[portal] Archive WAR file" + dir("${PROJECT_HOME}/eapim-portal/build/libs") { + archiveArtifacts artifacts: '*.war', fingerprint: true + } + } + } + } +} \ No newline at end of file