Jenkinsfile2 19.9 KB
Newer Older
L
liuyq-617 已提交
1 2 3 4 5 6
import hudson.model.Result
import hudson.model.*;
import jenkins.model.CauseOfInterruption
node {
}

T
tangfangzhi 已提交
7 8
win_test_stage = 0
linux_ready = 0
9 10
linux_node_ip = ""
linux_node_pass = ""
L
liuyq-617 已提交
11 12

def abortPreviousBuilds() {
T
tangfangzhi 已提交
13 14 15 16
    def currentJobName = env.JOB_NAME
    def currentBuildNumber = env.BUILD_NUMBER.toInteger()
    def jobs = Jenkins.instance.getItemByFullName(currentJobName)
    def builds = jobs.getBuilds()
L
liuyq-617 已提交
17

T
tangfangzhi 已提交
18 19 20 21
    for (build in builds) {
        if (!build.isBuilding()) {
            continue;
        }
L
liuyq-617 已提交
22

T
tangfangzhi 已提交
23 24 25
        if (currentBuildNumber == build.getNumber().toInteger()) {
            continue;
        }
L
liuyq-617 已提交
26

T
tangfangzhi 已提交
27 28
        build.doKill()    //doTerm(),doKill(),doTerm()
    }
L
liuyq-617 已提交
29 30 31 32
}
//  abort previous build
abortPreviousBuilds()
def abort_previous(){
T
tangfangzhi 已提交
33 34 35
    def buildNumber = env.BUILD_NUMBER as int
    if (buildNumber > 1) milestone(buildNumber - 1)
    milestone(buildNumber)
L
liuyq-617 已提交
36 37
}
def pre_test(){
38 39 40
    sh '''
        hostname
        date
41
        env
42 43 44 45 46 47 48
    '''
    sh '''
        cd ${WK}
        git reset --hard
        cd ${WKC}
        git reset --hard
    '''
L
liuyq-617 已提交
49
    script {
T
tangfangzhi 已提交
50 51
        if (env.CHANGE_TARGET == 'master') {
            sh '''
T
tangfangzhi 已提交
52 53
                cd ${WK}
                git checkout master
T
tangfangzhi 已提交
54 55 56 57 58
                cd ${WKC}
                git checkout master
            '''
        } else if(env.CHANGE_TARGET == '2.0') {
            sh '''
T
tangfangzhi 已提交
59 60
                cd ${WK}
                git checkout 2.0
T
tangfangzhi 已提交
61 62 63 64 65
                cd ${WKC}
                git checkout 2.0
            '''
        } else if(env.CHANGE_TARGET == '3.0') {
            sh '''
T
tangfangzhi 已提交
66 67
                cd ${WK}
                git checkout 3.0
T
tangfangzhi 已提交
68 69 70 71 72
                cd ${WKC}
                git checkout 3.0
            '''
        } else {
            sh '''
T
tangfangzhi 已提交
73 74
                cd ${WK}
                git checkout develop
T
tangfangzhi 已提交
75 76 77
                cd ${WKC}
                git checkout develop
            '''
L
liuyq-617 已提交
78
        }
T
tangfangzhi 已提交
79
    }
T
tangfangzhi 已提交
80 81 82
    if (env.CHANGE_URL =~ /\/TDengine\//) {
        sh '''
            cd ${WKC}
T
tangfangzhi 已提交
83
            git remote prune origin
T
tangfangzhi 已提交
84
            git pull >/dev/null
85
            git log -5
86 87
            echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log
            echo "community log: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
88 89
            git fetch origin +refs/pull/${CHANGE_ID}/merge
            git checkout -qf FETCH_HEAD
90
            git log -5
91
            echo "community log merged: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
92 93
            cd ${WK}
            git pull >/dev/null
94
            git log -5
95
            echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
96 97 98 99 100
        '''
    } else if (env.CHANGE_URL =~ /\/TDinternal\//) {
        sh '''
            cd ${WK}
            git pull >/dev/null
101
            git log -5
102 103
            echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log
            echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
104 105
            git fetch origin +refs/pull/${CHANGE_ID}/merge
            git checkout -qf FETCH_HEAD
106
            git log -5
107
            echo "tdinternal log merged: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
108
            cd ${WKC}
T
tangfangzhi 已提交
109
            git remote prune origin
T
tangfangzhi 已提交
110
            git pull >/dev/null
111
            git log -5
112
            echo "community log: `git log -5`" >>${WKDIR}/jenkins.log
T
tangfangzhi 已提交
113 114 115 116 117 118
        '''
    } else {
        sh '''
            echo "unmatched reposiotry ${CHANGE_URL}"
        '''
    }
T
tangfangzhi 已提交
119
    sh '''
L
liuyq-617 已提交
120
        cd ${WKC}
T
tangfangzhi 已提交
121 122 123 124 125 126
        git submodule update --init --recursive
    '''
    sh '''
        cd ${WKPY}
        git reset --hard
        git pull
127
        git log -5
128 129
        echo "python connector log: `git log -5`" >>${WKDIR}/jenkins.log
        echo >>${WKDIR}/jenkins.log
L
liuyq-617 已提交
130
    '''
T
tangfangzhi 已提交
131 132 133 134 135
    return 1
}
def pre_test_win(){
    bat '''
        hostname
T
tangfangzhi 已提交
136 137
        ipconfig
        set
T
tangfangzhi 已提交
138 139
        date /t
        time /t
T
tangfangzhi 已提交
140
        rd /s /Q %WIN_INTERNAL_ROOT%\\debug || exit 0
T
tangfangzhi 已提交
141 142
    '''
    bat '''
T
tangfangzhi 已提交
143
        cd %WIN_INTERNAL_ROOT%
144
        git reset --hard
T
tangfangzhi 已提交
145 146
    '''
    bat '''
T
tangfangzhi 已提交
147
        cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
148 149 150 151 152
        git reset --hard
    '''
    script {
        if (env.CHANGE_TARGET == 'master') {
            bat '''
T
tangfangzhi 已提交
153
                cd %WIN_INTERNAL_ROOT%
154
                git checkout master
T
tangfangzhi 已提交
155 156
            '''
            bat '''
T
tangfangzhi 已提交
157
                cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
158 159 160 161
                git checkout master
            '''
        } else if(env.CHANGE_TARGET == '2.0') {
            bat '''
T
tangfangzhi 已提交
162
                cd %WIN_INTERNAL_ROOT%
163
                git checkout 2.0
T
tangfangzhi 已提交
164 165
            '''
            bat '''
T
tangfangzhi 已提交
166
                cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
167 168 169 170
                git checkout 2.0
            '''
        } else if(env.CHANGE_TARGET == '3.0') {
            bat '''
T
tangfangzhi 已提交
171
                cd %WIN_INTERNAL_ROOT%
172
                git checkout 3.0
T
tangfangzhi 已提交
173 174
            '''
            bat '''
T
tangfangzhi 已提交
175
                cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
176 177 178 179
                git checkout 3.0
            '''
        } else {
            bat '''
T
tangfangzhi 已提交
180
                cd %WIN_INTERNAL_ROOT%
181
                git checkout develop
T
tangfangzhi 已提交
182 183
            '''
            bat '''
T
tangfangzhi 已提交
184
                cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
185 186 187 188
                git checkout develop
            '''
        }
    }
189 190 191
    script {
        if (env.CHANGE_URL =~ /\/TDengine\//) {
            bat '''
T
tangfangzhi 已提交
192
                cd %WIN_INTERNAL_ROOT%
193
                git pull
T
tangfangzhi 已提交
194 195
            '''
            bat '''
T
tangfangzhi 已提交
196 197
                cd %WIN_COMMUNITY_ROOT%
                git remote prune origin
198
                git pull
T
tangfangzhi 已提交
199 200
            '''
            bat '''
T
tangfangzhi 已提交
201
                cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
202 203 204
                git fetch origin +refs/pull/%CHANGE_ID%/merge
            '''
            bat '''
T
tangfangzhi 已提交
205
                cd %WIN_COMMUNITY_ROOT%
206 207 208 209
                git checkout -qf FETCH_HEAD
            '''
        } else if (env.CHANGE_URL =~ /\/TDinternal\//) {
            bat '''
T
tangfangzhi 已提交
210
                cd %WIN_INTERNAL_ROOT%
211
                git pull
T
tangfangzhi 已提交
212 213
            '''
            bat '''
T
tangfangzhi 已提交
214
                cd %WIN_INTERNAL_ROOT%
T
tangfangzhi 已提交
215 216 217
                git fetch origin +refs/pull/%CHANGE_ID%/merge
            '''
            bat '''
T
tangfangzhi 已提交
218
                cd %WIN_INTERNAL_ROOT%
219
                git checkout -qf FETCH_HEAD
T
tangfangzhi 已提交
220 221
            '''
            bat '''
T
tangfangzhi 已提交
222 223
                cd %WIN_COMMUNITY_ROOT%
                git remote prune origin
224 225 226
                git pull
            '''
        } else {
T
tangfangzhi 已提交
227 228
            bat '''
                echo "unmatched reposiotry %CHANGE_URL%"
229 230 231
            '''
        }
    }
T
tangfangzhi 已提交
232
    bat '''
T
tangfangzhi 已提交
233
        cd %WIN_INTERNAL_ROOT%
T
tangfangzhi 已提交
234
        git branch
T
tangfangzhi 已提交
235 236 237
        git log -5
    '''
    bat '''
T
tangfangzhi 已提交
238
        cd %WIN_COMMUNITY_ROOT%
T
tangfangzhi 已提交
239
        git branch
T
tangfangzhi 已提交
240 241
        git log -5
    '''
T
tangfangzhi 已提交
242
    bat '''
T
tangfangzhi 已提交
243
        cd %WIN_COMMUNITY_ROOT%
244
        git submodule update --init --recursive
T
tangfangzhi 已提交
245
    '''
246
    bat '''
T
tangfangzhi 已提交
247
        cd %WIN_CONNECTOR_ROOT%
248 249 250 251 252
        git branch
        git reset --hard
        git pull
    '''
    bat '''
T
tangfangzhi 已提交
253
        cd %WIN_CONNECTOR_ROOT%
254 255
        git log -5
    '''
T
tangfangzhi 已提交
256 257 258 259 260
}
def pre_test_build_win() {
    bat '''
        echo "building ..."
        time /t
T
tangfangzhi 已提交
261
        cd %WIN_INTERNAL_ROOT%
T
tangfangzhi 已提交
262 263
        mkdir debug
        cd debug
T
tangfangzhi 已提交
264
        time /t
T
tangfangzhi 已提交
265 266
        call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" x64
        set CL=/MP8
T
tangfangzhi 已提交
267 268
        echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> cmake"
        time /t
T
tangfangzhi 已提交
269
        cmake .. -G "NMake Makefiles JOM" || exit 7
T
tangfangzhi 已提交
270
        echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> jom -j 6"
271
        time /t
T
tangfangzhi 已提交
272
        jom -j 6 || exit 8
T
tangfangzhi 已提交
273
        time /t
T
tangfangzhi 已提交
274
    '''
275
    bat '''
T
tangfangzhi 已提交
276
        cd %WIN_CONNECTOR_ROOT%
277
        python -m pip install .
T
tangfangzhi 已提交
278
        xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
279
    '''
L
liuyq-617 已提交
280 281
    return 1
}
T
tangfangzhi 已提交
282
def run_win_ctest() {
T
tangfangzhi 已提交
283 284 285
    bat '''
        echo "windows ctest ..."
        time /t
T
tangfangzhi 已提交
286
        cd %WIN_INTERNAL_ROOT%\\debug
T
tangfangzhi 已提交
287
        ctest -j 1 || exit 7
T
tangfangzhi 已提交
288 289 290
        time /t
    '''
}
T
tangfangzhi 已提交
291
def run_win_test() {
292
    echo "LINUX NODE: ${linux_node_ip} - ${linux_node_pass}"
T
tangfangzhi 已提交
293 294
    bat '''
        echo "windows test ..."
T
tangfangzhi 已提交
295
        cd %WIN_CONNECTOR_ROOT%
T
tangfangzhi 已提交
296
        python -m pip install .
T
tangfangzhi 已提交
297
        xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
T
tangfangzhi 已提交
298
        ls -l C:\\Windows\\System32\\taos.dll
T
tangfangzhi 已提交
299
        time /t
T
tangfangzhi 已提交
300
        cd %WIN_SYSTEM_TEST_ROOT%
T
tangfangzhi 已提交
301
        echo "node: ''' + linux_node_ip + ''':''' + linux_node_pass + '''"
T
tangfangzhi 已提交
302
        echo "testing ..."
303
        test-all.bat  "{\\\"host\\\":\\\"''' + linux_node_ip + '''\\\",\\\"port\\\":22,\\\"user\\\":\\\"root\\\",\\\"password\\\":\\\"''' + linux_node_pass + '''\\\",\\\"path\\\":\\\"/var/lib/jenkins/workspace/TDinternal\\\"}"
T
tangfangzhi 已提交
304 305 306
        time /t
    '''
}
L
liuyq-617 已提交
307 308

pipeline {
T
tangfangzhi 已提交
309 310 311
    agent none
    options { skipDefaultCheckout() } 
    environment{
T
tangfangzhi 已提交
312
        WKDIR = '/var/lib/jenkins/workspace'
T
tangfangzhi 已提交
313
        WK = '/var/lib/jenkins/workspace/TDinternal'
T
tangfangzhi 已提交
314 315
        WKC = '/var/lib/jenkins/workspace/TDinternal/community'
        WKPY = '/var/lib/jenkins/workspace/taos-connector-python'
T
tangfangzhi 已提交
316 317 318 319
    }
    stages {
        stage('run test') {
            parallel {
T
tangfangzhi 已提交
320 321
                stage('windows test') {
                    agent{label " windows10_01 || windows10_02 || windows10_03 || windows10_04 "}
T
tangfangzhi 已提交
322 323 324 325 326 327
                    environment{
                        WIN_INTERNAL_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal"
                        WIN_COMMUNITY_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal\\community"
                        WIN_SYSTEM_TEST_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal\\community\\tests\\system-test"
                        WIN_CONNECTOR_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\taos-connector-python"
                    }
T
tangfangzhi 已提交
328
                    steps {
T
tangfangzhi 已提交
329
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
T
tangfangzhi 已提交
330
                            timeout(time: 55, unit: 'MINUTES'){
T
tangfangzhi 已提交
331 332 333
                                pre_test_win()
                                pre_test_build_win()
                                run_win_ctest()
T
tangfangzhi 已提交
334 335 336 337
                                script {
                                    while(linux_ready == 0) {
                                        sleep(8)
                                    }
T
tangfangzhi 已提交
338 339 340 341 342 343 344
                                }
                                run_win_test()
                            }
                        }
                        script {
                            win_test_stage = 1
                        }
T
tangfangzhi 已提交
345 346
                    }
                }
T
tangfangzhi 已提交
347
                stage('linux test') {
T
tangfangzhi 已提交
348
                    agent{label " worker03 || slave215 || slave217 || slave219 "}
T
tangfangzhi 已提交
349 350 351 352 353
                    options { skipDefaultCheckout() } 
                    when {
                        changeRequest()
                    }
                    steps {
354 355
                        script {
                            linux_node_ip = sh (
356
                                script: 'jq .ip /home/node_info.json | sed "s/\\\"//g"',
357 358 359
                                returnStdout: true
                            ).trim()
                            linux_node_pass = sh (
T
tangfangzhi 已提交
360
                                script: 'jq .password /home/node_info.json | sed "s/\\\"//g" |sed "s/\\!/^^^^^^^^\\!/g"',
361 362
                                returnStdout: true
                            ).trim()
363
                            echo "${linux_node_ip}:${linux_node_pass}"
364
                        }
T
tangfangzhi 已提交
365 366
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                            timeout(time: 40, unit: 'MINUTES'){
367
                                pre_test()
T
tangfangzhi 已提交
368 369 370 371
                                script {
                                    sh '''
                                        date
                                        rm -rf ${WKC}/debug
372
                                        cd ${WKC}/tests/parallel_test
T
tangfangzhi 已提交
373 374 375 376
                                        time ./container_build.sh -w ${WKDIR} -t 8 -e
                                        rm -f /tmp/cases.task
                                        ./collect_cases.sh -e
                                    '''
T
tangfangzhi 已提交
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
                                    def extra_param = ""
                                    def log_server_file = "/home/log_server.json"
                                    def timeout_cmd = ""
                                    if (fileExists(log_server_file)) {
                                        def log_server_enabled = sh (
                                            script: 'jq .enabled ' + log_server_file,
                                            returnStdout: true
                                        ).trim()
                                        def timeout_param = sh (
                                            script: 'jq .timeout ' + log_server_file,
                                            returnStdout: true
                                        ).trim()
                                        if (timeout_param != "null" &&  timeout_param != "0") {
                                            timeout_cmd = "timeout " + timeout_param
                                        }
                                        if (log_server_enabled == "1") {
                                            def log_server = sh (
                                                script: 'jq .server ' + log_server_file + ' | sed "s/\\\"//g"',
                                                returnStdout: true
                                            ).trim()
                                            if (log_server != "null" && log_server != "") { 
                                                extra_param = "-w " + log_server
                                            }
                                        }
                                    }
T
tangfangzhi 已提交
402 403 404 405
                                    sh '''
                                        cd ${WKC}/tests/parallel_test
                                        export DEFAULT_RETRY_TIME=2
                                        date
T
tangfangzhi 已提交
406
                                        ''' + timeout_cmd + ''' time ./run.sh -e -m /home/m.json -t /tmp/cases.task -b ${BRANCH_NAME}_${BUILD_ID} -l ${WKDIR}/log -o 480 ''' + extra_param + '''
T
tangfangzhi 已提交
407 408 409 410
                                    '''
                                }
                            }
                        }
T
tangfangzhi 已提交
411
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
T
tangfangzhi 已提交
412
                            timeout(time: 15, unit: 'MINUTES'){
T
tangfangzhi 已提交
413 414 415 416
                                script {
                                    sh '''
                                        echo "packaging ..."
                                        date
417
                                        rm -rf ${WKC}/release/*
T
tangfangzhi 已提交
418 419
                                        cd ${WKC}/packaging
                                        ./release.sh -v cluster -n 3.0.0.100 -s static
T
tangfangzhi 已提交
420 421 422
                                    '''
                                    sh '''
                                        echo "install ..."
T
tangfangzhi 已提交
423 424
                                        cd ${WKC}/release
                                        tar xzf TDengine-enterprise-server-3.0.0.100-Linux-x64.tar.gz
T
tangfangzhi 已提交
425
                                        cd TDengine-enterprise-server-3.0.0.100
T
tangfangzhi 已提交
426 427 428
                                        service taosd stop || :
                                        rm -rf /var/lib/taos
                                        ./install.sh -e no
T
tangfangzhi 已提交
429 430 431 432 433
                                    '''
                                    sh '''
                                        echo "checking ..."
                                        which taos
                                        which taosd
T
tangfangzhi 已提交
434 435
                                        rm -rf ${WK}/debug
                                        mv ${WKC}/debug ${WK}/
T
tangfangzhi 已提交
436
                                    '''
T
tangfangzhi 已提交
437
                                    sh '''
T
tangfangzhi 已提交
438
                                        echo "install taospy ..."
T
tangfangzhi 已提交
439 440
                                        cd ${WKPY}
                                        pip3 install .
T
tangfangzhi 已提交
441
                                    '''
442 443 444 445 446 447 448 449 450 451
                                }
                            }
                        }
                        script {
                            linux_ready = 1
                        }
                        script {
                            while(win_test_stage == 0){
                                sleep(12)
                            }
T
tangfangzhi 已提交
452 453 454
                        }
                    }
                }
L
liuyq-617 已提交
455
            }
T
tangfangzhi 已提交
456 457 458
        }
    }
    post {  
L
liuyq-617 已提交
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
        success {
            emailext (
                subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS",
                body: """<!DOCTYPE html>
                <html>
                <head>
                <meta charset="UTF-8">
                </head>
                <body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0">
                    <table width="95%" cellpadding="0" cellspacing="0" style="font-size: 16pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
                        <tr>
                            <td><br />
                                <b><font color="#0B610B"><font size="6">构建信息</font></font></b>
                                <hr size="2" width="100%" align="center" /></td>
                        </tr>
                        <tr>
                            <td>
                                <ul>
                                <div style="font-size:18px">
                                    <li>构建名称>>分支:${env.BRANCH_NAME}</li>
                                    <li>构建结果:<span style="color:green"> Successful </span></li>
                                    <li>构建编号:${BUILD_NUMBER}</li>
                                    <li>触发用户:${env.CHANGE_AUTHOR}</li>
                                    <li>提交信息:${env.CHANGE_TITLE}</li>
                                    <li>构建地址:<a href=${BUILD_URL}>${BUILD_URL}</a></li>
                                    <li>构建日志:<a href=${BUILD_URL}console>${BUILD_URL}console</a></li>
                                    
                                </div>
                                </ul>
                            </td>
                        </tr>
                    </table></font>
                </body>
                </html>""",
                to: "${env.CHANGE_AUTHOR_EMAIL}",
                from: "support@taosdata.com"
            )
        }
        failure {
            emailext (
                subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' FAIL",
                body: """<!DOCTYPE html>
                <html>
                <head>
                <meta charset="UTF-8">
                </head>
                <body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0">
                    <table width="95%" cellpadding="0" cellspacing="0" style="font-size: 16pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
                        <tr>
                            <td><br />
                                <b><font color="#0B610B"><font size="6">构建信息</font></font></b>
                                <hr size="2" width="100%" align="center" /></td>
                        </tr>
                        <tr>
                            <td>
                                <ul>
                                <div style="font-size:18px">
                                    <li>构建名称>>分支:${env.BRANCH_NAME}</li>
                                    <li>构建结果:<span style="color:red"> Failure </span></li>
                                    <li>构建编号:${BUILD_NUMBER}</li>
                                    <li>触发用户:${env.CHANGE_AUTHOR}</li>
                                    <li>提交信息:${env.CHANGE_TITLE}</li>
                                    <li>构建地址:<a href=${BUILD_URL}>${BUILD_URL}</a></li>
                                    <li>构建日志:<a href=${BUILD_URL}console>${BUILD_URL}console</a></li>
                                    
                                </div>
                                </ul>
                            </td>
                        </tr>
                    </table></font>
                </body>
                </html>""",
                to: "${env.CHANGE_AUTHOR_EMAIL}",
                from: "support@taosdata.com"
            )
        }
    } 
}