#!/usr/bin/env groovy
|
|
node {
|
|
|
|
def REPOSITORY = "ssh://git@gitlab.mrbird.cc:2223/aobei/febs-cloud.git"
|
|
def SCRIPT_PATH = "/febs/bash"
|
|
def WORKSPACE = "/root/.jenkins/workspace/febs-cloud"
|
|
|
|
|
|
stage('拉取代码') {
|
|
echo "从GitLab地址${REPOSITORY}拉取代码"
|
|
deleteDir()
|
|
git "${REPOSITORY}"
|
|
}
|
|
stage('代码编译及单元测试') {
|
|
echo "开始编译代码和单元测试"
|
|
dir("${WORKSPACE}/febs-cloud") {
|
|
sh "mvn -U -am clean package -DskipTests"
|
|
}
|
|
}
|
|
stage('Docker镜像构建及推送') {
|
|
echo "开始构建Docker镜像并推送到Harbor"
|
|
dir("${WORKSPACE}/febs-auth") {
|
|
echo "开始构建febs-auth"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-auth"
|
|
}
|
|
dir("${WORKSPACE}/febs-gateway") {
|
|
echo "开始构建febs-gateway"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-gateway"
|
|
}
|
|
dir("${WORKSPACE}/febs-tx-manager") {
|
|
echo "开始构建febs-tx-manager"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-tx-manager"
|
|
}
|
|
dir("${WORKSPACE}/febs-apm/febs-admin") {
|
|
echo "开始构建febs-admin"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-admin"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-generator") {
|
|
echo "开始构建febs-server-generator"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-generator"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-job") {
|
|
echo "开始构建febs-server-job"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-job"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-system") {
|
|
echo "开始构建febs-server-system"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-system"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-test") {
|
|
echo "开始构建febs-server-test"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-test"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-ai-estate") {
|
|
echo "开始构建febs-server-ai-estate"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-ai-estate"
|
|
}
|
|
dir("${WORKSPACE}/febs-server/febs-server-fastdfs") {
|
|
echo "开始构建febs-server-fastdfs"
|
|
sh "${SCRIPT_PATH}/build_push.sh febs-server-fastdfs"
|
|
}
|
|
}
|
|
}
|