[2025-06-27] 修改发布文档
All checks were successful
Publish to Confluence / confluence (push) Successful in 15s

This commit is contained in:
liuxiaohua 2025-06-27 16:51:34 +08:00
parent b30946e26f
commit 6dda62521e
2 changed files with 67 additions and 33 deletions

View File

@ -123,6 +123,10 @@ ALTER TABLE `zt_task`
- 所属岗位由 `/api/pssystem/module/getConfig` 接口维护
- 需求验收拆分UAT和生产前端改就行
#### 接口文档
- http://yapi.qifu.com/project/488/interface/api
## 六、工作量和排期
### 开发时间

96
草稿/Jenkinsfile vendored
View File

@ -1,48 +1,78 @@
pipeline {
pipeline{
agent any
// options {
// ansiColor('xterm')
// }
// properties([parameters([gitParameter(branch: '', branchFilter: '.*', defaultValue: '*/master', name: 'buildBranch', quickFilterEnabled: false, selectedValue: 'NONE', sortMode: 'NONE', tagFilter: '*', type: 'GitParameterDefinition')])])
tools {
maven: 'MavenInner'
}
parameters {
// string(name: 'BRANCH_NAME', defaultValue: 'main', description: '请输入要构建的分支名称')
gitParameter(branch: '', branchFilter: '.*', defaultValue: '*/master', name: 'buildBranch', quickFilterEnabled: false, selectedValue: 'NONE', sortMode: 'NONE', tagFilter: '*', type: 'GitParameterDefinition')
options {
timestamps()
// daysToKeepStr:<Days to keep builds>, numToKeepStr:<Max # of builds to keep>
buildDiscarder(logRotator(daysToKeepStr: '7', numToKeepStr: '10'))
}
environment {
GIT_CREDENTIALS = credentials('your-gitlab-credentials-id')
GIT_URL='ssh://git@git.keyfil.com:9922/qifu-gateway/keycloak-justauth.git'
// Git Info 需修改
__Git_Addr = 'http://git.keyfil.com/saas-back-end/qifu-saas-eg.git'
__Git_Name = "${__Git_Addr.split('/')[-1].split('.git')[0]}"
wxbot_id = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9245d561-9d29-4d58-be39-5edc3dba293d'
}
stages {
stage('Checkout') {
steps {
echo "正在从 GitLab 拉取 ${params.BRANCH_NAME} 分支的代码..."
// git credentialsId: "${GIT_CREDENTIALS}", url: 'https://gitlab.com/your-repo.git', branch: "${params.BRANCH_NAME}"
git branch: "${params.buildBranch}", credentialsId: '1', url: "${GIT_URL}"
parameters {
// TAG
//gitParameter(name:'BRANCH', type: 'PT_TAG', defaultValue: 'master', sortMode: 'DESCENDING_SMART', selectedValue: 'TOP', quickFilterEnabled: true)
gitParameter branch: '', branchFilter: '.*', defaultValue: 'master', listSize: '', name: 'BRANCH', quickFilterEnabled: true, selectedValue: 'NONE', sortMode: 'NONE', tagFilter: '*', type: 'GitParameterDefinition'
}
stages{
stage("Git Code") {
steps{
deleteDir()
script{
checkout([$class: 'GitSCM', branches: [[name: "${BRANCH}"]], extensions: [], userRemoteConfigs: [[credentialsId: 'gitlab', url: "${__Git_Addr}"]]])
}
}
}
stage('Maven Build') {
steps {
echo "开始执行 Maven 构建..."
sh 'mvn clean test jacoco:report -Daliyun=*'
stage("Build") {
steps{
dir("${WORKSPACE}"){
script {
sh "source /etc/profile;mvn clean package -P development -DskipTests -U"
}
}
}
}
stage('Generate Coverage Report') {
steps {
echo "使用 Git Forensics 统计代码变更..."
discoverGitReferenceBuild referenceJob: 'Jacoco测试', targetBranch: '$referenceJob'
recordCoverage qualityGates: [[criticality: 'NOTE', metric: 'MODULE'], [baseline: 'MODIFIED_FILES', criticality: 'NOTE', metric: 'FILE'], [baseline: 'MODIFIED_LINES', criticality: 'NOTE', metric: 'LINE']], tools: [[parser: 'JACOCO']]
stage("Docker Build&Push&Publish") {
steps{
dir("${WORKSPACE}"){
script{
jar_name = sh (returnStdout: true, script: 'ls qifu-saas-eg-service/target/ | grep \'.jar\' | grep -v \'sources\' | head -n 1').trim()
sh """
rm Dockerfile -rf
cp /opt/data/oom-test.sh /opt/data/mc .
cp /opt/data/apache-skywalking-java-agent-9.4.0.tgz .
JAR_NAME=${jar_name}
echo 'FROM ubuntu:16.04 as jar' >> Dockerfile
echo 'WORKDIR /' >> Dockerfile
echo 'RUN apt-get update -y' >> Dockerfile
echo 'RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget' >> Dockerfile
echo 'RUN wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.20.0/jmx_prometheus_javaagent-0.20.0.jar' >> Dockerfile
echo 'FROM openjdk:11' >> Dockerfile
echo \"ADD qifu-saas-eg-service/target/\${JAR_NAME} /app/\${JAR_NAME}\" >> Dockerfile
echo 'COPY --from=jar /jmx_prometheus_javaagent-0.20.0.jar /app/jmx_prometheus_javaagent-0.20.0.jar' >> Dockerfile
echo 'COPY oom-test.sh /app/' >> Dockerfile
echo 'COPY mc /usr/local/sbin/' >> Dockerfile
echo 'ADD apache-skywalking-java-agent-9.4.0.tgz /app/' >> Dockerfile
echo 'ENV TZ=Asia/Shanghai' >> Dockerfile
echo 'EXPOSE 8088' >> Dockerfile
echo 'EXPOSE 8933' >> Dockerfile
echo 'ENTRYPOINT ["java", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/app/dump.hprof", "-XX:+ExitOnOutOfMemoryError", "-XX:OnOutOfMemoryError=/app/oom-test.sh", "-javaagent:/app/skywalking-agent/skywalking-agent.jar", "-Dskywalking.agent.service_name=qifu-saas-eg-test", "-Dskywalking.collector.backend_service=oap.qifu.svc:11800", "-jar", "-javaagent:/app/jmx_prometheus_javaagent-0.20.0.jar=8088:/app/jmx_exporter.yaml", "/app/${jar_name}"]' >> Dockerfile
"""
sh '''
tag=`date +%s`;docker build -t harbor.qifu.com/qifu-test/qifu-saas-eg:${VERSION}-${tag} .
docker push harbor.qifu.com/qifu-test/qifu-saas-eg:${VERSION}-${tag}
kubectl set image deployment/qifu-saas-eg qifu-saas-eg=harbor.qifu.com/qifu-test/qifu-saas-eg:${VERSION}-$tag -n qifu
'''
}
}
}
}
}
post {
success {
echo "构建成功!"
}
failure {
echo "构建失败,请检查日志。"
failure{
qyWechatNotification mentionedId: '', mentionedMobile: '16620101812', moreInfo: '', webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9245d561-9d29-4d58-be39-5edc3dba293d'
}
}
}