Jenkinsfile 3.2 KB
Newer Older
Y
Yiqing Liu 已提交
1
pipeline {
L
liuyq-617 已提交
2 3 4 5 6
  agent none
  environment{
      WK = '/var/lib/jenkins/workspace/TDinternal'
      WKC= '/var/lib/jenkins/workspace/TDinternal/community'
  }
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
  stages{
    stage('pre build'){
      agent{label 'master'}
      steps{
        sh '''
            ${WKC}
            td=`git diff develop remotes/origin/develop`
            if [ ! $td ];then
                echo "no changes,skip build"
                exit 0
            fi
            echo "check OK!"
            '''
      }
    }
  }
Y
Yiqing Liu 已提交
23
  stages {
L
liuyq-617 已提交
24
      stage('Parallel test stage') {
Y
Yiqing Liu 已提交
25
      parallel {
L
liuyq-617 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
        stage('pytest') {
          agent{label 'master'}
          steps {
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests
            #./test-all.sh smoke
            ./test-all.sh pytest
            date'''
          }
        }
L
liuyq-617 已提交
51 52
        stage('test_b1') {
          agent{label '184'}
Y
Yiqing Liu 已提交
53
          steps {
L
liuyq-617 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests
            #./test-all.sh smoke
L
liuyq-617 已提交
72
            ./test-all.sh b1
L
liuyq-617 已提交
73
            date'''
Y
Yiqing Liu 已提交
74 75 76 77
          }
        }

        stage('test_crash_gen') {
L
liuyq-617 已提交
78
          agent{label "185"}
Y
Yiqing Liu 已提交
79
          steps {
L
liuyq-617 已提交
80
            sh '''
L
liuyq-617 已提交
81
            
L
liuyq-617 已提交
82 83 84 85 86 87 88 89
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
L
liuyq-617 已提交
90
            
L
liuyq-617 已提交
91 92 93 94 95 96
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests/pytest
L
liuyq-617 已提交
97
            ./crash_gen.sh -a -p -t 4 -s 2000
L
liuyq-617 已提交
98 99
            date
            cd ${WKC}/tests
L
liuyq-617 已提交
100
            ./test-all.sh b2
L
liuyq-617 已提交
101 102
            date
            '''
Y
Yiqing Liu 已提交
103 104 105 106
          }
        }

        stage('test_valgrind') {
L
liuyq-617 已提交
107
          agent{label "186"}
Y
Yiqing Liu 已提交
108
          steps {
L
liuyq-617 已提交
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests/pytest
L
liuyq-617 已提交
126
            ./valgrind-test.sh 2>&1 > mem-error-out.log
127 128
            ./handle_val_log.sh
          
L
liuyq-617 已提交
129
            date
L
liuyq-617 已提交
130 131
            cd ${WKC}/tests
            ./test-all.sh b3
L
liuyq-617 已提交
132
            date'''
Y
Yiqing Liu 已提交
133 134 135 136 137 138 139
          }
        }

      }
    }

  }
L
liuyq-617 已提交
140 141
  
}