Jenkinsfile 4.0 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'
  }
L
liuyq-617 已提交
7

Y
Yiqing Liu 已提交
8
  stages {
L
liuyq-617 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22
      stage('pre build'){
        agent{label 'master'}
        steps{
          sh '''
              cd ${WKC}
              td=`git diff develop remotes/origin/develop`
              if [ ! $td ];then
                  echo "no changes,skip build"
                  exit 0
              fi
              echo "check OK!"
              '''
        }
      }
L
liuyq-617 已提交
23
      stage('Parallel test stage') {
Y
Yiqing Liu 已提交
24
      parallel {
L
liuyq-617 已提交
25 26 27 28
        stage('pytest') {
          agent{label 'master'}
          steps {
            sh '''
L
liuyq-617 已提交
29 30 31 32 33 34 35
            cd ${WKC}
              td=`git diff develop remotes/origin/develop`
              if [ ! $td ];then
                  echo "no changes,skip build"
                  exit 0
              fi
            
L
liuyq-617 已提交
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
            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 已提交
57 58
        stage('test_b1') {
          agent{label '184'}
Y
Yiqing Liu 已提交
59
          steps {
L
liuyq-617 已提交
60
            sh '''
L
liuyq-617 已提交
61 62 63 64 65 66
            cd ${WKC}
              td=`git diff develop remotes/origin/develop`
              if [ ! $td ];then
                  echo "no changes,skip build"
                  exit 0
              fi
L
liuyq-617 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
            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 已提交
84
            ./test-all.sh b1
L
liuyq-617 已提交
85
            date'''
Y
Yiqing Liu 已提交
86 87 88 89
          }
        }

        stage('test_crash_gen') {
L
liuyq-617 已提交
90
          agent{label "185"}
Y
Yiqing Liu 已提交
91
          steps {
L
liuyq-617 已提交
92
            sh '''
L
liuyq-617 已提交
93 94 95 96 97 98
            cd ${WKC}
              td=`git diff develop remotes/origin/develop`
              if [ ! $td ];then
                  echo "no changes,skip build"
                  exit 0
              fi
L
liuyq-617 已提交
99 100 101 102 103 104 105 106
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
L
liuyq-617 已提交
107
            
L
liuyq-617 已提交
108 109 110 111 112 113
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests/pytest
L
liuyq-617 已提交
114
            ./crash_gen.sh -a -p -t 4 -s 2000
L
liuyq-617 已提交
115 116
            date
            cd ${WKC}/tests
L
liuyq-617 已提交
117
            ./test-all.sh b2
L
liuyq-617 已提交
118 119
            date
            '''
Y
Yiqing Liu 已提交
120 121 122 123
          }
        }

        stage('test_valgrind') {
L
liuyq-617 已提交
124
          agent{label "186"}
Y
Yiqing Liu 已提交
125
          steps {
L
liuyq-617 已提交
126
            sh '''
L
liuyq-617 已提交
127 128 129 130 131 132
            cd ${WKC}
              td=`git diff develop remotes/origin/develop`
              if [ ! $td ];then
                  echo "no changes,skip build"
                  exit 0
              fi
L
liuyq-617 已提交
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
            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 已提交
149
            ./valgrind-test.sh 2>&1 > mem-error-out.log
150 151
            ./handle_val_log.sh
          
L
liuyq-617 已提交
152
            date
L
liuyq-617 已提交
153 154
            cd ${WKC}/tests
            ./test-all.sh b3
L
liuyq-617 已提交
155
            date'''
Y
Yiqing Liu 已提交
156 157 158 159 160 161 162
          }
        }

      }
    }

  }
L
liuyq-617 已提交
163 164
  
}