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

L
liuyq-617 已提交
7 8 9
def skipbuild = 0
def win_stop = 0
def scope = []
L
liuyq-617 已提交
10
def mod = [0,1,2,3,4]
L
liuyq-617 已提交
11
def sim_mod = [0,1,2,3]
L
liuyq-617 已提交
12

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

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

L
recover  
liuyq-617 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37
    if (currentBuildNumber == build.getNumber().toInteger()) {
      continue;
    }

    build.doKill()    //doTerm(),doKill(),doTerm()
  }
}
//  abort previous build
abortPreviousBuilds()
def abort_previous(){
  def buildNumber = env.BUILD_NUMBER as int
  if (buildNumber > 1) milestone(buildNumber - 1)
  milestone(buildNumber)
}
38
def pre_test(){
L
liuyq-617 已提交
39
    sh'hostname'
L
liuyq-617 已提交
40 41 42
    sh '''
    sudo rmtaos || echo "taosd has not installed"
    '''
L
liuyq-617 已提交
43
    sh '''
44 45
    kill -9 $(pidof taosd) ||echo "no taosd running"
    kill -9 $(pidof taosadapter) ||echo "no taosadapter running"
L
fix  
liuyq-617 已提交
46
    killall -9 gdb || echo "no gdb running"
L
liuyq-617 已提交
47
    killall -9 python3.8 || echo "no python program running"
48
    cd ${WKC}
L
liuyq-617 已提交
49
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
50
    git reset --hard HEAD~10 >/dev/null
L
fix  
liuyq-617 已提交
51 52 53
    '''
    script {
      if (env.CHANGE_TARGET == 'master') {
L
fix  
liuyq-617 已提交
54
        sh '''
55 56
        cd ${WKC}
        git checkout master
L
fix  
liuyq-617 已提交
57
        '''
L
fix  
liuyq-617 已提交
58
        }
59
      else if(env.CHANGE_TARGET == '2.0'){
L
fix  
liuyq-617 已提交
60
        sh '''
61 62
        cd ${WKC}
        git checkout 2.0
L
fix  
liuyq-617 已提交
63
        '''
64
      }
65 66
      else{
        sh '''
67 68
        cd ${WKC}
        git checkout develop
69 70
        '''
      }
L
fix  
liuyq-617 已提交
71 72
    }
    sh'''
L
fix  
liuyq-617 已提交
73
    cd ${WKC}
74
    git remote prune origin
75 76
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
    git pull >/dev/null
L
liuyq-617 已提交
77
    git fetch origin +refs/pull/${CHANGE_ID}/merge
78
    git checkout -qf FETCH_HEAD
79
    git clean -dfx
80
    git submodule update --init --recursive
L
update  
liuyq-617 已提交
81
    cd src/kit/taos-tools/deps/avro
L
update  
liuyq-617 已提交
82
    git clean -dfx
83 84
    cd ${WK}
    git reset --hard HEAD~10
L
fix  
liuyq-617 已提交
85
    '''
86 87 88 89 90 91 92 93 94 95 96 97
    script {
      if (env.CHANGE_TARGET == 'master') {
        sh '''
        cd ${WK}
        git checkout master
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        sh '''
        cd ${WK}
        git checkout 2.0
        '''
98
      }
99 100 101 102 103
      else{
        sh '''
        cd ${WK}
        git checkout develop
        '''
104
      }
105
    }
L
fix  
liuyq-617 已提交
106
    sh '''
107
    cd ${WK}
108 109
    git pull >/dev/null

110 111
    export TZ=Asia/Harbin
    date
112
    git clean -dfx
113 114
    mkdir debug
    cd debug
115
    cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null
116 117 118
    make > /dev/null
    make install > /dev/null
    cd ${WKC}/tests
119
    pip3 install ${WKC}/src/connector/python/
L
update  
liuyq-617 已提交
120 121 122 123 124 125
    '''
    return 1
}
def pre_test_noinstall(){
    sh'hostname'
    sh'''
126
    cd ${WKC}
L
liuyq-617 已提交
127
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
128
    git reset --hard HEAD~10 >/dev/null
L
update  
liuyq-617 已提交
129 130 131 132
    '''
    script {
      if (env.CHANGE_TARGET == 'master') {
        sh '''
133 134
        cd ${WKC}
        git checkout master
L
update  
liuyq-617 已提交
135 136 137 138
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        sh '''
139 140
        cd ${WKC}
        git checkout 2.0
L
update  
liuyq-617 已提交
141
        '''
142
      }
L
update  
liuyq-617 已提交
143 144
      else{
        sh '''
145 146
        cd ${WKC}
        git checkout develop
L
update  
liuyq-617 已提交
147 148 149 150 151
        '''
      }
    }
    sh'''
    cd ${WKC}
152
    git remote prune origin
153 154
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
    git pull >/dev/null
L
update  
liuyq-617 已提交
155 156
    git fetch origin +refs/pull/${CHANGE_ID}/merge
    git checkout -qf FETCH_HEAD
157
    git clean -dfx
L
update  
liuyq-617 已提交
158
    git submodule update --init --recursive
L
update  
liuyq-617 已提交
159
    cd src/kit/taos-tools/deps/avro
L
update  
liuyq-617 已提交
160
    git clean -dfx
161 162
    cd ${WK}
    git reset --hard HEAD~10
L
update  
liuyq-617 已提交
163
    '''
164 165 166 167 168 169 170 171 172 173 174 175
    script {
      if (env.CHANGE_TARGET == 'master') {
        sh '''
        cd ${WK}
        git checkout master
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        sh '''
        cd ${WK}
        git checkout 2.0
        '''
176
      }
177 178 179 180 181
      else{
        sh '''
        cd ${WK}
        git checkout develop
        '''
182
      }
183
    }
L
update  
liuyq-617 已提交
184
    sh '''
185
    cd ${WK}
186 187
    git pull >/dev/null

L
update  
liuyq-617 已提交
188 189
    export TZ=Asia/Harbin
    date
190
    git clean -dfx
L
update  
liuyq-617 已提交
191 192
    mkdir debug
    cd debug
193
    cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null
194
    make
L
liuyq-617 已提交
195
    '''
196 197
    return 1
}
L
liuyq-617 已提交
198 199 200
def pre_test_mac(){
    sh'hostname'
    sh'''
201
    cd ${WKC}
L
liuyq-617 已提交
202
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
203
    git reset --hard HEAD~10 >/dev/null
L
liuyq-617 已提交
204 205 206 207
    '''
    script {
      if (env.CHANGE_TARGET == 'master') {
        sh '''
208 209
        cd ${WKC}
        git checkout master
L
liuyq-617 已提交
210 211 212 213
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        sh '''
214 215
        cd ${WKC}
        git checkout 2.0
L
liuyq-617 已提交
216
        '''
217
      }
L
liuyq-617 已提交
218 219
      else{
        sh '''
220 221
        cd ${WKC}
        git checkout develop
L
liuyq-617 已提交
222 223 224 225 226
        '''
      }
    }
    sh'''
    cd ${WKC}
227
    git remote prune origin
228 229
    [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
    git pull >/dev/null
L
liuyq-617 已提交
230 231
    git fetch origin +refs/pull/${CHANGE_ID}/merge
    git checkout -qf FETCH_HEAD
232
    git clean -dfx
L
liuyq-617 已提交
233
    git submodule update --init --recursive
L
update  
liuyq-617 已提交
234
    cd src/kit/taos-tools/deps/avro
L
update  
liuyq-617 已提交
235
    git clean -dfx
236 237
    cd ${WK}
    git reset --hard HEAD~10
L
liuyq-617 已提交
238
    '''
239 240 241 242 243 244 245 246 247 248 249 250
    script {
      if (env.CHANGE_TARGET == 'master') {
        sh '''
        cd ${WK}
        git checkout master
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        sh '''
        cd ${WK}
        git checkout 2.0
        '''
251
      }
252 253 254 255 256
      else{
        sh '''
        cd ${WK}
        git checkout develop
        '''
257
      }
258
    }
L
liuyq-617 已提交
259
    sh '''
260
    cd ${WK}
261 262
    git pull >/dev/null

L
liuyq-617 已提交
263 264
    export TZ=Asia/Harbin
    date
265
    git clean -dfx
L
liuyq-617 已提交
266 267
    mkdir debug
    cd debug
268
    cmake .. -DBUILD_TOOLS=false > /dev/null
269 270
    go env -w GOPROXY=https://goproxy.cn,direct
    go env -w GO111MODULE=on
L
liuyq-617 已提交
271 272 273 274
    cmake --build .
    '''
    return 1
}
275 276
def pre_test_win(){
    bat '''
L
update  
liuyq-617 已提交
277
    taskkill /f /t /im python.exe
278 279
    cd C:\\
    rd /s /Q C:\\TDengine
280 281 282
    cd C:\\workspace\\TDinternal
    rd /s /Q C:\\workspace\\TDinternal\\debug
    cd C:\\workspace\\TDinternal\\community
283
    git reset --hard HEAD~10
284 285 286 287
    '''
    script {
      if (env.CHANGE_TARGET == 'master') {
        bat '''
288 289
        cd C:\\workspace\\TDinternal\\community
        git checkout master
290 291 292 293
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        bat '''
294 295
        cd C:\\workspace\\TDinternal\\community
        git checkout 2.0
296
        '''
297
      }
298 299
      else{
        bat '''
300 301
        cd C:\\workspace\\TDinternal\\community
        git checkout develop
302 303 304 305 306
        '''
      }
    }
    bat'''
    cd C:\\workspace\\TDinternal\\community
307 308
    git remote prune origin
    git pull
L
liuyq-617 已提交
309
    git fetch origin +refs/pull/%CHANGE_ID%/merge
310
    git checkout -qf FETCH_HEAD
311
    git clean -dfx
312
    git submodule update --init --recursive
313 314
    cd C:\\workspace\\TDinternal
    git reset --hard HEAD~10
315
    '''
316 317 318 319 320 321 322 323 324 325 326 327
    script {
      if (env.CHANGE_TARGET == 'master') {
        bat '''
        cd C:\\workspace\\TDinternal
        git checkout master
        '''
        }
      else if(env.CHANGE_TARGET == '2.0'){
        bat '''
        cd C:\\workspace\\TDinternal
        git checkout 2.0
        '''
328
      }
329 330 331 332 333
      else{
        bat '''
        cd C:\\workspace\\TDinternal
        git checkout develop
        '''
334
      }
335
    }
336 337
    bat '''
    cd C:\\workspace\\TDinternal
338
    git pull
339

340
    date
341
    git clean -dfx
342 343
    mkdir debug
    cd debug
L
liuyq-617 已提交
344
    call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
345
    cmake ../ -G "NMake Makefiles"
L
liuyq-617 已提交
346
    set CL=/MP nmake nmake || exit 8
L
update  
liuyq-617 已提交
347
    nmake install || exit 8
L
liuyq-617 已提交
348
    xcopy /e/y/i/f C:\\workspace\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 || exit 8
349 350
    cd C:\\workspace\\TDinternal\\community\\src\\connector\\python
    python -m pip install .
351

352 353 354
    '''
    return 1
}
Y
Yiqing Liu 已提交
355
pipeline {
L
liuyq-617 已提交
356
  agent none
357
  options { skipDefaultCheckout() }
L
liuyq-617 已提交
358 359 360 361
  environment{
      WK = '/var/lib/jenkins/workspace/TDinternal'
      WKC= '/var/lib/jenkins/workspace/TDinternal/community'
  }
Y
Yiqing Liu 已提交
362
  stages {
L
change  
liuyq-617 已提交
363
      stage('pre_build'){
L
update  
liuyq-617 已提交
364
          agent{label 'master'}
365
          options { skipDefaultCheckout() }
L
liuyq-617 已提交
366 367 368
          when {
              changeRequest()
          }
369
          steps {
L
change  
liuyq-617 已提交
370 371 372
            script{
              abort_previous()
              abortPreviousBuilds()
L
update  
liuyq-617 已提交
373 374 375
              scope = ['connector','query','insert','other','tools','taosAdapter']
              Collections.shuffle mod
              Collections.shuffle sim_mod
L
liuyq-617 已提交
376 377
              }
            }    
378
      }
L
change  
liuyq-617 已提交
379
      stage('Parallel test stage') {
L
liuyq-617 已提交
380
        //only build pr
381
        options { skipDefaultCheckout() }
L
liuyq-617 已提交
382
        when {
L
liuyq-617 已提交
383
          allOf{
L
liuyq-617 已提交
384
              changeRequest()
385
              not{ expression { env.CHANGE_BRANCH =~ /docs\// }}
L
liuyq-617 已提交
386
            }
L
liuyq-617 已提交
387
          }
Y
Yiqing Liu 已提交
388
      parallel {
L
liuyq-617 已提交
389
        stage('python_1') {
L
liuyq-617 已提交
390
          agent{label " slave1 || slave11 "}
L
liuyq-617 已提交
391
          steps {
392
            pre_test()
C
cpwu 已提交
393
            timeout(time: 100, unit: 'MINUTES'){
L
liuyq-617 已提交
394 395 396 397 398
              script{
                scope.each {
                  sh """
                    date
                    cd ${WKC}/tests
L
liuyq-617 已提交
399
                    ./test-CI.sh ${it} 5 ${mod[0]}
L
liuyq-617 已提交
400 401 402 403
                    date"""
                  }
                }
            }            
L
liuyq-617 已提交
404 405
          }
        }
L
liuyq-617 已提交
406
        stage('python_2') {
L
liuyq-617 已提交
407
          agent{label " slave2 || slave12 "}
L
liuyq-617 已提交
408 409
          steps {
            pre_test()
C
cpwu 已提交
410
            timeout(time: 100, unit: 'MINUTES'){
L
liuyq-617 已提交
411 412 413 414 415
                 script{
                  scope.each {
                    sh """
                      date
                      cd ${WKC}/tests
L
liuyq-617 已提交
416
                      ./test-CI.sh ${it} 5 ${mod[1]} 
L
liuyq-617 已提交
417 418 419
                      date"""
                    }
                }
L
liuyq-617 已提交
420
            }
L
liuyq-617 已提交
421 422
          }
        }
L
liuyq-617 已提交
423
        stage('python_3') {
L
liuyq-617 已提交
424
          agent{label " slave3 || slave13 "}
425
          steps {
426
            timeout(time: 105, unit: 'MINUTES'){
L
liuyq-617 已提交
427
              pre_test()
L
liuyq-617 已提交
428 429 430 431 432
              script{
              scope.each {
                sh """
                  date
                  cd ${WKC}/tests
L
liuyq-617 已提交
433
                  ./test-CI.sh ${it} 5 ${mod[2]}
L
liuyq-617 已提交
434 435
                  date"""
                }
436
              }
L
liuyq-617 已提交
437
            }
Y
Yiqing Liu 已提交
438 439
          }
        }
L
liuyq-617 已提交
440
        stage('python_4') {
L
liuyq-617 已提交
441
          agent{label " slave4 || slave14 "}
442
          steps {
C
cpwu 已提交
443
            timeout(time: 100, unit: 'MINUTES'){
L
liuyq-617 已提交
444
              pre_test()
L
liuyq-617 已提交
445 446 447 448 449
              script{
              scope.each {
                sh """
                  date
                  cd ${WKC}/tests
L
liuyq-617 已提交
450
                  ./test-CI.sh ${it} 5 ${mod[3]}
L
liuyq-617 已提交
451 452 453 454
                  date"""
                }
              }
          
L
liuyq-617 已提交
455 456 457
            }
          }
        }
L
liuyq-617 已提交
458
        stage('python_5') {
L
liuyq-617 已提交
459
          agent{label " slave5 || slave15 "}
460
          steps {
C
cpwu 已提交
461
            timeout(time: 100, unit: 'MINUTES'){
L
liuyq-617 已提交
462
              pre_test()
L
liuyq-617 已提交
463 464 465 466 467
              script{
              scope.each {
                sh """
                  date
                  cd ${WKC}/tests
L
liuyq-617 已提交
468
                  ./test-CI.sh ${it} 5 ${mod[4]}
L
liuyq-617 已提交
469 470 471 472
                  date"""
                }
              }
          
L
liuyq-617 已提交
473 474
            }
          }
475
        }
L
liuyq-617 已提交
476 477 478 479 480 481 482 483 484 485
        stage('sim_1') {
          agent{label " slave6 || slave16 "}
          steps {
            pre_test()
            timeout(time: 100, unit: 'MINUTES'){
                  sh """
                    date
                    cd ${WKC}/tests
                    ./test-CI.sh sim 4 ${sim_mod[0]}
                    date"""
L
liuyq-617 已提交
486 487
              }
          }            
L
liuyq-617 已提交
488 489 490 491 492 493
        }
        stage('sim_2') {
          agent{label " slave7 || slave17 "}
          steps {
            pre_test()
            timeout(time: 100, unit: 'MINUTES'){
L
liuyq-617 已提交
494 495 496 497 498
              sh """
                date
                cd ${WKC}/tests
                ./test-CI.sh sim 4 ${sim_mod[1]} 
                date"""
L
liuyq-617 已提交
499 500 501 502 503 504 505 506
            }
          }
        }
        stage('sim_3') {
          agent{label " slave8 || slave18 "}
          steps {
            timeout(time: 105, unit: 'MINUTES'){
              pre_test()
L
liuyq-617 已提交
507 508 509 510 511
              sh """
                date
                cd ${WKC}/tests
                ./test-CI.sh sim 4 ${sim_mod[2]}
                date"""
L
liuyq-617 已提交
512 513 514 515 516 517 518 519
            }
          }
        }
        stage('sim_4') {
          agent{label " slave9 || slave19 "}
          steps {
            timeout(time: 100, unit: 'MINUTES'){
              pre_test()
L
liuyq-617 已提交
520 521 522 523 524
              sh """
                date
                cd ${WKC}/tests
                ./test-CI.sh sim 4 ${sim_mod[3]}
                date"""
L
liuyq-617 已提交
525 526
              }
            }
L
liuyq-617 已提交
527
          
L
liuyq-617 已提交
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
        }
        stage('other') {
          agent{label " slave10 || slave20 "}
          steps {
            timeout(time: 100, unit: 'MINUTES'){
              pre_test()
              timeout(time: 60, unit: 'MINUTES'){
                sh '''
                cd ${WKC}/tests/pytest
                ./crash_gen.sh -a -p -t 4 -s 2000
                '''
              }
              timeout(time: 60, unit: 'MINUTES'){
                sh '''
                cd ${WKC}/tests/pytest
                rm -rf /var/lib/taos/*
                rm -rf /var/log/taos/*
                ./handle_crash_gen_val_log.sh
                '''
                sh '''
                cd ${WKC}/tests/pytest
                rm -rf /var/lib/taos/*
                rm -rf /var/log/taos/*
                ./handle_taosd_val_log.sh
                '''
              }
              catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
                sh '''
                cd ${WKC}/tests/pytest
                ./valgrind-test.sh 2>&1 > mem-error-out.log
                ./handle_val_log.sh
                '''
              } 
              sh '''
                cd ${WKC}/tests
                ./test-all.sh full unit
                date
              '''
            }
          }
        }
L
liuyq-617 已提交
569 570
        stage('centos7') {
          agent{label " centos7 "}
571 572
          steps {
              pre_test_noinstall()
L
liuyq-617 已提交
573 574 575 576
            }
        }
        stage('ubuntu:trusty') {
          agent{label " trusty "}
577 578
          steps {
              pre_test_noinstall()
L
liuyq-617 已提交
579 580 581 582
            }
        }
        stage('ubuntu:xenial') {
          agent{label " xenial "}
583 584
          steps {
              pre_test_noinstall()
L
liuyq-617 已提交
585 586 587 588
            }
        }
        stage('ubuntu:bionic') {
          agent{label " bionic "}
589 590
          steps {
              pre_test_noinstall()
L
liuyq-617 已提交
591 592
            }
        }
L
liuyq-617 已提交
593 594
        stage('Mac_build') {
          agent{label " catalina "}
595 596
          steps {
              pre_test_mac()
L
liuyq-617 已提交
597 598
            }
        }
L
liuyq-617 已提交
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657
        stage('arm64centos7') {
          agent{label " arm64centos7 "}
          steps {     
              pre_test_noinstall()    
            }
        }
        stage('arm64centos8') {
          agent{label " arm64centos8 "}
          steps {     
              pre_test_noinstall()    
            }
        }
        stage('arm32bionic') {
          agent{label " arm32bionic "}
          steps {     
              pre_test_noinstall()    
            }
        }
        stage('arm64bionic') {
          agent{label " arm64bionic "}
          steps {     
              pre_test_noinstall()    
            }
        }
        stage('arm64focal') {
          agent{label " arm64focal "}
          steps {     
              pre_test_noinstall()    
            }
        }
        stage('build'){
          agent{label " wintest "}
          steps {
            pre_test()
            script{             
                while(win_stop == 0){
                  sleep(1)
                  }
              }
            }
        }
        stage('test'){
          agent{label "win"}
          steps{
            
            catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                pre_test_win()
                timeout(time: 20, unit: 'MINUTES'){
                bat'''
                cd C:\\workspace\\TDinternal\\community\\tests\\pytest
                .\\test-all.bat wintest
                '''
                }
            }     
            script{
              win_stop=1
            }
          }
        }
Y
Yiqing Liu 已提交
658 659
    }
  }
L
liuyq-617 已提交
660
  }
661
  post {
662 663
        success {
            emailext (
664 665
                subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS",
                body: """<!DOCTYPE html>
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680
                <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">
681
                                    <li>构建名称>>分支:${env.BRANCH_NAME}</li>
682 683
                                    <li>构建结果:<span style="color:green"> Successful </span></li>
                                    <li>构建编号:${BUILD_NUMBER}</li>
684
                                    <li>触发用户:${env.CHANGE_AUTHOR}</li>
L
fix  
liuyq-617 已提交
685
                                    <li>提交信息:${env.CHANGE_TITLE}</li>
686 687 688 689 690 691 692 693
                                    <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>
694
                </html>""",
L
liuyq-617 已提交
695
                to: "${env.CHANGE_AUTHOR_EMAIL}",
696 697 698 699 700
                from: "support@taosdata.com"
            )
        }
        failure {
            emailext (
701 702
                subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' FAIL",
                body: """<!DOCTYPE html>
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
                <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">
718
                                    <li>构建名称>>分支:${env.BRANCH_NAME}</li>
L
liuyq-617 已提交
719
                                    <li>构建结果:<span style="color:red"> Failure </span></li>
720
                                    <li>构建编号:${BUILD_NUMBER}</li>
721
                                    <li>触发用户:${env.CHANGE_AUTHOR}</li>
L
fix  
liuyq-617 已提交
722
                                    <li>提交信息:${env.CHANGE_TITLE}</li>
723 724 725 726 727 728 729 730
                                    <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>
731
                </html>""",
L
liuyq-617 已提交
732
                to: "${env.CHANGE_AUTHOR_EMAIL}",
733 734 735
                from: "support@taosdata.com"
            )
        }
736
    }
X
xiaolei li 已提交
737
}
L
liuyq-617 已提交
738