|
|
|
@@ -21,6 +21,15 @@ pipeline { |
|
|
|
sh "mvn -f ${project_name} clean package -e -U -Dmaven.test.skip=true sonar:sonar" |
|
|
|
} |
|
|
|
} |
|
|
|
stage('Quality Gate') { |
|
|
|
steps { |
|
|
|
timeout(time: 1, unit: 'HOURS') { |
|
|
|
// Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails |
|
|
|
// true = set pipeline to UNSTABLE, false = don't waitForQualityGates abortPipeline: true |
|
|
|
waitForQualityGate abortPipeline: true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// build Docker并推送镜像仓库 |
|
|
|
stage('Push to Registry') { |
|
|
|
steps { |
|
|
|
@@ -33,18 +42,22 @@ pipeline { |
|
|
|
if ("${project_name}" == 'digimeta-MultiSaas' ) { |
|
|
|
echo '仅做代码检查,不打包目录' |
|
|
|
} else { |
|
|
|
echo "构件微服务 ${project_name},并推送到镜像仓库" |
|
|
|
echo "构件微服务 ${modules_name},并推送到镜像仓库" |
|
|
|
sh """ |
|
|
|
cd ${workspace}/${project_name} |
|
|
|
docker login --username=缔智元2023 --password=digimeta@2023 ${ali_registry} |
|
|
|
docker build --tag ${ali_registry}/digitalman-multisaas/${project_name}:${version} . |
|
|
|
docker push ${ali_registry}/digitalman-multisaas/${project_name}:${version} |
|
|
|
docker rmi ${ali_registry}/digitalman-multisaas/${project_name}:${version} |
|
|
|
docker build --tag ${ali_registry}/digitalman-multisaas/${modules_name}:${version} . |
|
|
|
docker push ${ali_registry}/digitalman-multisaas/${modules_name}:${version} |
|
|
|
docker rmi ${ali_registry}/digitalman-multisaas/${modules_name}:${version} |
|
|
|
""" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
stage('Deploy to Test Environment') { |
|
|
|
// 远程连接ssh |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |