MPtestJenkinsfile 13.8 KB
Newer Older
haoranc's avatar
haoranc 已提交
1 2 3
def sync_source(branch_name) {
    sh '''
        hostname
haoranc's avatar
haoranc 已提交
4
        ip addr|grep 192|awk  '{print $2}'|sed "s/\\/.*//"  
haoranc's avatar
haoranc 已提交
5 6 7 8 9 10
        echo ''' + branch_name + '''
    '''
    sh '''
        cd ${TDENGINE_ROOT_DIR}
        git reset --hard
        git fetch || git fetch
haoranc's avatar
haoranc 已提交
11
        rm -rf examples/rust/
haoranc's avatar
haoranc 已提交
12 13 14 15
        git checkout ''' + branch_name + ''' -f
        git branch
        git pull || git pull
        git log | head -n 20
16
        git clean -fxd
haoranc's avatar
haoranc 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
    '''
    return 1
}
def run_test() {
    sh '''
        cd ${TDENGINE_ROOT_DIR}/packaging
        
    '''
    sh '''
        export LD_LIBRARY_PATH=${TDINTERNAL_ROOT_DIR}/debug/build/lib
        ./fulltest.sh
    '''
    sh '''
        cd ${TDENGINE_ROOT_DIR}/tests
        ./test-all.sh b1fq
    '''
}
def build_run() {
    sync_source("${BRANCH_NAME}")
}
pipeline {
    agent none
    parameters {
40 41
        choice(
            name: 'sourcePath',
42
            choices: ['nas','web'], 
43 44 45 46 47 48
            description: 'Choice which way to download the installation pacakge;web is Office Web and nas means taos nas server '
        )
        choice(
            name: 'verMode',
            choices: ['all','community','enterprise'], 
            description: 'Choice  which types of package you want do check '
49
        )
haoranc's avatar
haoranc 已提交
50 51
        string (
            name:'version', 
52 53
            defaultValue:'3.0.1.7', 
            description: 'Release version number,eg: 3.0.0.1 or 3.0.0.'
haoranc's avatar
haoranc 已提交
54 55 56
        )
        string (
            name:'baseVersion', 
57 58
            defaultValue:'3.0.1.7', 
            description: 'The number of baseVerison is generally not modified.Now it is 3.0.0.1'
haoranc's avatar
haoranc 已提交
59
        )
haoranc's avatar
haoranc 已提交
60 61
        string (
            name:'toolsVersion', 
62
            defaultValue:'2.2.7', 
63
            description: 'Release version number,eg:2.2.0'
haoranc's avatar
haoranc 已提交
64 65 66 67
        )
        string (
            name:'toolsBaseVersion', 
            defaultValue:'2.1.2', 
68
            description: 'The number of baseVerison is generally not modified.Now it is 2.1.2'
haoranc's avatar
haoranc 已提交
69
        )
haoranc's avatar
haoranc 已提交
70 71 72 73 74
    }
    environment{
        WORK_DIR = '/var/lib/jenkins/workspace'
        TDINTERNAL_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal'
        TDENGINE_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal/community'
75
        BRANCH_NAME = '3.0'
76 77
        
        TD_SERVER_TAR = "${preServerPackag}-${version}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
78
        BASE_TD_SERVER_TAR = "TDengine-server-${baseVersion}-Linux-x64.tar.gz"
79
    
haoranc's avatar
haoranc 已提交
80 81 82 83 84 85 86
        TD_SERVER_ARM_TAR = "TDengine-server-${version}-Linux-arm64.tar.gz"
        BASE_TD_SERVER_ARM_TAR = "TDengine-server-${baseVersion}-Linux-arm64.tar.gz"

        TD_SERVER_LITE_TAR = "TDengine-server-${version}-Linux-x64-Lite.tar.gz"
        BASE_TD_SERVER_LITE_TAR = "TDengine-server-${baseVersion}-Linux-x64-Lite.tar.gz"

        TD_CLIENT_TAR = "TDengine-client-${version}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
87
        BASE_TD_CLIENT_TAR = "TDengine-client-${baseVersion}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102

        TD_CLIENT_ARM_TAR = "TDengine-client-${version}-Linux-arm64.tar.gz"
        BASE_TD_CLIENT_ARM_TAR = "TDengine-client-${baseVersion}-Linux-arm64.tar.gz"

        TD_CLIENT_LITE_TAR = "TDengine-client-${version}-Linux-x64-Lite.tar.gz"
        BASE_TD_CLIENT_LITE_TAR = "TDengine-client-${baseVersion}-Linux-x64-Lite.tar.gz"

        TD_SERVER_RPM = "TDengine-server-${version}-Linux-x64.rpm"
        
        TD_SERVER_DEB = "TDengine-server-${version}-Linux-x64.deb"

        TD_SERVER_EXE = "TDengine-server-${version}-Windows-x64.exe"
        
        TD_CLIENT_EXE = "TDengine-client-${version}-Windows-x64.exe"

haoranc's avatar
haoranc 已提交
103 104
        TD_TOOLS_TAR = "taosTools-${toolsVersion}-Linux-x64.tar.gz"

haoranc's avatar
haoranc 已提交
105 106 107

    }
    stages {
haoranc's avatar
haoranc 已提交
108
        stage ('Test Server') {
haoranc's avatar
haoranc 已提交
109 110 111 112
            parallel {
                stage('ubuntu16') {
                    agent{label " ubuntu16 "}
                    steps {
haoranc's avatar
haoranc 已提交
113
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
114
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
115
                            sh '''
116 117 118
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi
119
                            verModeList=${verMode}                          
120 121 122 123 124 125
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
                                bash testpackage.sh -f server -m ${verModeSin} -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                                python3 checkPackageRuning.py
                            done 
126
                            '''  
127

128
                            sh '''                              
haoranc's avatar
haoranc 已提交
129
                            cd ${TDENGINE_ROOT_DIR}/packaging
130 131 132 133 134 135 136
                            bash testpackage.sh -f server -m community -f server  -l true -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                            python3 checkPackageRuning.py
                            '''   

                            sh ''' 
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh -f server -m community -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t deb 
137
                            python3 checkPackageRuning.py
haoranc's avatar
haoranc 已提交
138 139 140 141 142 143 144
                            '''
                        }
                    }
                }
                stage('ubuntu18') {
                    agent{label " ubuntu18 "}
                    steps {
haoranc's avatar
haoranc 已提交
145
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
146
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
147
                            sh '''
148 149 150 151 152 153 154 155 156 157
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi
                            verModeList=${verMode}
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
                                bash testpackage.sh -f server -m ${verModeSin} -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                                python3 checkPackageRuning.py
                            done 
158 159 160 161 162 163 164
                            '''

                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh -f server -m community -f server  -l true -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                            python3 checkPackageRuning.py
                            '''
165

166
                            sh '''
haoranc's avatar
haoranc 已提交
167
                            cd ${TDENGINE_ROOT_DIR}/packaging
168
                            bash testpackage.sh -f server -m community -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t deb 
169
                            python3 checkPackageRuning.py
haoranc's avatar
haoranc 已提交
170
                            dpkg -r tdengine
171
                            '''                                
haoranc's avatar
haoranc 已提交
172 173 174 175 176 177
                        }
                    }
                }
                stage('centos7') {
                    agent{label " centos7_9 "}
                    steps {
haoranc's avatar
haoranc 已提交
178
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
179
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
180
                            sh '''
181 182 183 184 185 186 187
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi                            
                            verModeList=${verMode}
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
188
                                bash testpackage.sh -f server -m community -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
189 190
                                python3 checkPackageRuning.py
                            done 
191 192 193 194 195 196 197
                            '''

                            sh '''                            
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh -f server -m community -f server  -l true -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                            python3 checkPackageRuning.py
                            '''
198

199
                            sh '''
haoranc's avatar
haoranc 已提交
200
                            cd ${TDENGINE_ROOT_DIR}/packaging
201
                            bash testpackage.sh -f server -m community -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t rpm 
202
                            python3 checkPackageRuning.py
haoranc's avatar
haoranc 已提交
203 204 205 206 207 208 209
                            '''
                        }
                    }
                }
                stage('centos8') {
                    agent{label " centos8_3 "}
                    steps {
haoranc's avatar
haoranc 已提交
210
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
211
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
212
                            sh '''
213 214 215 216 217 218 219 220 221
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi                            
                            verModeList=${verMode}
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
                                bash testpackage.sh -f server -m ${verModeSin} -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                                python3 checkPackageRuning.py
222 223
                            done
                            '''
224

225
                            sh '''
haoranc's avatar
haoranc 已提交
226
                            cd ${TDENGINE_ROOT_DIR}/packaging
227 228 229 230 231 232 233
                            bash testpackage.sh -f server -m community -f server  -l true -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                            python3 checkPackageRuning.py
                            '''

                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh -f server -m community -f server  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t rpm 
234
                            python3 checkPackageRuning.py
haoranc's avatar
haoranc 已提交
235
                            sudo rpm -e tdengine 
236
                            '''
237 238
                        }
                    }
haoranc's avatar
haoranc 已提交
239
                }                  
240 241 242 243 244 245
                stage('arm64') {
                    agent{label 'linux_arm64'}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
                            sync_source("${BRANCH_NAME}")
                            sh '''
246 247 248 249 250 251 252 253 254 255
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi                            
                            verModeList=${verMode}
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
                                bash testpackage.sh -f server -m ${verModeSin} -f server  -l false -c arm64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
                                python3 checkPackageRuning.py
                            done 
haoranc's avatar
haoranc 已提交
256
                            '''
haoranc's avatar
haoranc 已提交
257 258 259 260 261 262 263 264 265 266 267
                        }
                    }
                }
            }
        }
        stage ('Test Client') {
            parallel {
                stage('ubuntu18') {
                    agent{label " ubuntu18 "}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
268
                            sh '''
269 270 271 272 273 274 275 276
                            if [ "${verMode}" = "all" ];then
                                verMode="community enterprise"
                            fi  
                            verModeList=${verMode}
                            for verModeSin in ${verModeList}
                            do
                                cd ${TDENGINE_ROOT_DIR}/packaging
                                bash testpackage.sh -f server -m ${verModeSin} -f client  -l false -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar 
277
                                python3 checkPackageRuning.py 192.168.0.21
278
                            done 
haoranc's avatar
haoranc 已提交
279
                            '''
haoranc's avatar
haoranc 已提交
280 281 282
                        }
                    }
                }
haoranc's avatar
haoranc 已提交
283 284 285 286 287
                stage('centos8') {
                    agent{label " centos8_3 "}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
                            sh '''
288 289 290
                            verModeList=community
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh -f server -m ${verModeSin} -f client  -l true -c x64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar
haoranc's avatar
haoranc 已提交
291 292 293 294 295
                            python3 checkPackageRuning.py  192.168.0.24
                            '''         
                        }
                    }
                }      
haoranc's avatar
haoranc 已提交
296
            }
haoranc's avatar
haoranc 已提交
297 298 299 300 301 302
        }  
        stage('arm64-client') {
            agent{label " linux_arm64 "}
            steps {
                timeout(time: 30, unit: 'MINUTES'){
                    sh '''
303 304 305 306 307 308 309
                    if [ "${verMode}" = "all" ];then
                        verMode="community enterprise"
                    fi  
                    verModeList=${verMode}
                    for verModeSin in ${verModeList}
                    do
                        cd ${TDENGINE_ROOT_DIR}/packaging
310
                        bash testpackage.sh -f server -m ${verModeSin} -f client  -l false -c arm64  -v ${version} -o ${baseVersion} -s ${sourcePath}  -t tar
311
                        python3 checkPackageRuning.py 192.168.0.21
312
                    done 
haoranc's avatar
haoranc 已提交
313 314 315 316 317
                    '''  
                }
            }
        } 
    }    
haoranc's avatar
haoranc 已提交
318
}