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

def abortPreviousBuilds() {
T
tangfangzhi 已提交
8 9 10 11
    def currentJobName = env.JOB_NAME
    def currentBuildNumber = env.BUILD_NUMBER.toInteger()
    def jobs = Jenkins.instance.getItemByFullName(currentJobName)
    def builds = jobs.getBuilds()
L
liuyq-617 已提交
12

T
tangfangzhi 已提交
13 14 15 16
    for (build in builds) {
        if (!build.isBuilding()) {
            continue;
        }
L
liuyq-617 已提交
17

T
tangfangzhi 已提交
18 19 20
        if (currentBuildNumber == build.getNumber().toInteger()) {
            continue;
        }
L
liuyq-617 已提交
21

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

pipeline {
T
tangfangzhi 已提交
344 345 346
    agent none
    options { skipDefaultCheckout() } 
    environment{
T
tangfangzhi 已提交
347
        WKDIR = '/var/lib/jenkins/workspace'
T
tangfangzhi 已提交
348
        WK = '/var/lib/jenkins/workspace/TDinternal'
T
tangfangzhi 已提交
349 350
        WKC = '/var/lib/jenkins/workspace/TDinternal/community'
        WKPY = '/var/lib/jenkins/workspace/taos-connector-python'
T
tangfangzhi 已提交
351 352 353
    }
    stages {
        stage('run test') {
T
tangfangzhi 已提交
354 355 356 357 358
            when {
                allOf {
                    not { expression { env.CHANGE_BRANCH =~ /docs\// }}
                }
            }
T
tangfangzhi 已提交
359
            parallel {
T
tangfangzhi 已提交
360 361
                stage('windows test') {
                    agent{label " windows10_01 || windows10_02 || windows10_03 || windows10_04 "}
T
tangfangzhi 已提交
362 363 364 365 366 367
                    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 已提交
368
                    steps {
T
tangfangzhi 已提交
369
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
T
tangfangzhi 已提交
370
                            timeout(time: 55, unit: 'MINUTES'){
T
tangfangzhi 已提交
371 372 373 374 375 376
                                pre_test_win()
                                pre_test_build_win()
                                run_win_ctest()
                                run_win_test()
                            }
                        }
T
tangfangzhi 已提交
377 378
                    }
                }
T
tangfangzhi 已提交
379 380 381 382 383 384 385 386 387 388 389
                stage('mac test') {
                    agent{label " Mac_catalina "}
                    steps {
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                            timeout(time: 20, unit: 'MINUTES'){
                                pre_test()
                                pre_test_build_mac()
                            }
                        }
                    }
                }
T
tangfangzhi 已提交
390
                stage('linux test') {
T
tangfangzhi 已提交
391
                    agent{label " worker03 || slave215 || slave217 || slave219 "}
T
tangfangzhi 已提交
392 393 394 395 396
                    options { skipDefaultCheckout() } 
                    when {
                        changeRequest()
                    }
                    steps {
397 398 399 400 401 402 403 404
                        script {
                            def linux_node_ip = sh (
                                script: 'ip addr|grep 192|grep -v virbr|awk "{print \\\$2}"|sed "s/\\/.*//"',
                                returnStdout: true
                            ).trim()
                            echo "${linux_node_ip}"
                            echo "${WKDIR}/restore.sh -p ${BRANCH_NAME} -n ${BUILD_ID} -c {container name}"
                        }
T
tangfangzhi 已提交
405
                        catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
406
                            timeout(time: 120, unit: 'MINUTES'){
407
                                pre_test()
T
tangfangzhi 已提交
408 409 410 411
                                script {
                                    sh '''
                                        date
                                        rm -rf ${WKC}/debug
412
                                        cd ${WKC}/tests/parallel_test
T
tangfangzhi 已提交
413 414 415 416
                                        time ./container_build.sh -w ${WKDIR} -t 8 -e
                                        rm -f /tmp/cases.task
                                        ./collect_cases.sh -e
                                    '''
T
tangfangzhi 已提交
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
                                    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 已提交
442 443 444 445
                                    sh '''
                                        cd ${WKC}/tests/parallel_test
                                        export DEFAULT_RETRY_TIME=2
                                        date
T
tangfangzhi 已提交
446
                                        ''' + 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 已提交
447 448 449 450
                                    '''
                                }
                            }
                        }
T
tangfangzhi 已提交
451
                        /*catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
T
tangfangzhi 已提交
452
                            timeout(time: 15, unit: 'MINUTES'){
T
tangfangzhi 已提交
453 454 455 456
                                script {
                                    sh '''
                                        echo "packaging ..."
                                        date
457
                                        rm -rf ${WKC}/release/*
T
tangfangzhi 已提交
458 459
                                        cd ${WKC}/packaging
                                        ./release.sh -v cluster -n 3.0.0.100 -s static
T
tangfangzhi 已提交
460
                                    '''
461 462
                                }
                            }
T
tangfangzhi 已提交
463
                        }*/
T
tangfangzhi 已提交
464 465
                    }
                }
L
liuyq-617 已提交
466
            }
T
tangfangzhi 已提交
467 468 469
        }
    }
    post {  
L
liuyq-617 已提交
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 537 538 539 540 541 542 543 544 545 546 547
        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"
            )
        }
    } 
}