jenkins pipeline 추가
This commit is contained in:
Vendored
+80
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user