MPtestJenkinsfile 10.9 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 42 43 44
        choice(
            name: 'sourcePath',
            choices: ['web', 'nas'], 
            description: 'choice which way to download the installation pacakge;web is Office Web and nas means taos nas server '
        )
haoranc's avatar
haoranc 已提交
45 46
        string (
            name:'version', 
47
            defaultValue:'3.0.1.6', 
haoranc's avatar
haoranc 已提交
48 49 50 51
            description: 'release version number,eg: 3.0.0.1 or 3.0.0.'
        )
        string (
            name:'baseVersion', 
52
            defaultValue:'3.0.1.6', 
haoranc's avatar
haoranc 已提交
53 54
            description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
        )
haoranc's avatar
haoranc 已提交
55 56
        string (
            name:'toolsVersion', 
57
            defaultValue:'2.2.7', 
haoranc's avatar
haoranc 已提交
58 59 60 61 62 63 64
            description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
        )
        string (
            name:'toolsBaseVersion', 
            defaultValue:'2.1.2', 
            description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
        )
haoranc's avatar
haoranc 已提交
65 66 67 68 69
    }
    environment{
        WORK_DIR = '/var/lib/jenkins/workspace'
        TDINTERNAL_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal'
        TDENGINE_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal/community'
70
        BRANCH_NAME = 'test/TD-20194'
haoranc's avatar
haoranc 已提交
71 72

        TD_SERVER_TAR = "TDengine-server-${version}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
73
        BASE_TD_SERVER_TAR = "TDengine-server-${baseVersion}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
74 75 76 77 78 79 80 81

        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 已提交
82
        BASE_TD_CLIENT_TAR = "TDengine-client-${baseVersion}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97

        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 已提交
98 99
        TD_TOOLS_TAR = "taosTools-${toolsVersion}-Linux-x64.tar.gz"

haoranc's avatar
haoranc 已提交
100 101 102

    }
    stages {
haoranc's avatar
haoranc 已提交
103
        stage ('Test Server') {
haoranc's avatar
haoranc 已提交
104 105 106 107
            parallel {
                stage('ubuntu16') {
                    agent{label " ubuntu16 "}
                    steps {
haoranc's avatar
haoranc 已提交
108
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
109
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
110 111
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
112
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath}
haoranc's avatar
haoranc 已提交
113 114 115 116
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
117
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
118 119 120 121
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
122
                            bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
123 124 125 126 127 128 129 130
                            python3 checkPackageRuning.py  
                            '''
                        }
                    }
                }
                stage('ubuntu18') {
                    agent{label " ubuntu18 "}
                    steps {
haoranc's avatar
haoranc 已提交
131
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
132
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
133 134
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
135
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server  ${sourcePath} 
haoranc's avatar
haoranc 已提交
136 137 138 139
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
140
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
141 142 143 144
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
145
                            bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server   ${sourcePath}
haoranc's avatar
haoranc 已提交
146
                            python3 checkPackageRuning.py  
haoranc's avatar
haoranc 已提交
147
                            dpkg -r tdengine
haoranc's avatar
haoranc 已提交
148
                            '''
haoranc's avatar
haoranc 已提交
149

haoranc's avatar
haoranc 已提交
150 151 152 153 154 155
                        }
                    }
                }
                stage('centos7') {
                    agent{label " centos7_9 "}
                    steps {
haoranc's avatar
haoranc 已提交
156
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
157
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
158 159
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
160
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
161 162 163 164
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
165
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${sourcePath}
haoranc's avatar
haoranc 已提交
166 167 168 169
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
170
                            bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
171 172 173 174 175 176 177 178
                            python3 checkPackageRuning.py  
                            '''
                        }
                    }
                }
                stage('centos8') {
                    agent{label " centos8_3 "}
                    steps {
haoranc's avatar
haoranc 已提交
179
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
180
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
181
                            sh '''
182
                            cd ${TDENGINE_ROOT_DIR}/packaging 
183
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server   ${sourcePath}
184 185 186
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
haoranc's avatar
haoranc 已提交
187
                            cd ${TDENGINE_ROOT_DIR}/packaging
188
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server  ${sourcePath}
haoranc's avatar
haoranc 已提交
189 190 191 192
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
193
                            bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server  ${sourcePath}
194
                            python3 checkPackageRuning.py  
haoranc's avatar
haoranc 已提交
195 196
                            sudo rpm -e tdengine 
                            '''              
197 198
                        }
                    }
haoranc's avatar
haoranc 已提交
199
                }                  
200 201 202 203 204 205 206
                stage('arm64') {
                    agent{label 'linux_arm64'}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
                            sync_source("${BRANCH_NAME}")
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
207
                            bash testpackage.sh ${TD_SERVER_ARM_TAR} ${version} ${BASE_TD_SERVER_ARM_TAR} ${baseVersion} server ${sourcePath} 
haoranc's avatar
haoranc 已提交
208 209
                            python3 checkPackageRuning.py  
                            '''
haoranc's avatar
haoranc 已提交
210 211 212 213 214 215 216 217 218 219 220
                        }
                    }
                }
            }
        }
        stage ('Test Client') {
            parallel {
                stage('ubuntu18') {
                    agent{label " ubuntu18 "}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
221 222
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
223
                            bash testpackage.sh ${TD_CLIENT_TAR} ${version} ${BASE_TD_CLIENT_TAR} ${baseVersion} client ${sourcePath}
haoranc's avatar
haoranc 已提交
224 225
                            python3 checkPackageRuning.py  192.168.0.21
                            '''
haoranc's avatar
haoranc 已提交
226 227 228
                        }
                    }
                }
haoranc's avatar
haoranc 已提交
229 230 231 232 233 234
                stage('centos8') {
                    agent{label " centos8_3 "}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
235
                            bash testpackage.sh ${TD_CLIENT_LITE_TAR} ${version} ${BASE_TD_CLIENT_LITE_TAR} ${baseVersion} client  ${sourcePath}
haoranc's avatar
haoranc 已提交
236 237 238 239 240
                            python3 checkPackageRuning.py  192.168.0.24
                            '''         
                        }
                    }
                }      
haoranc's avatar
haoranc 已提交
241
            }
haoranc's avatar
haoranc 已提交
242 243 244 245 246 247 248
        }  
        stage('arm64-client') {
            agent{label " linux_arm64 "}
            steps {
                timeout(time: 30, unit: 'MINUTES'){
                    sh '''
                    cd ${TDENGINE_ROOT_DIR}/packaging
249
                    bash testpackage.sh ${TD_CLIENT_ARM_TAR} ${version} ${BASE_TD_CLIENT_ARM_TAR} ${baseVersion} client  ${sourcePath}
haoranc's avatar
haoranc 已提交
250 251 252 253 254 255
                    python3 checkPackageRuning.py  192.168.0.21
                    '''  
                }
            }
        } 
    }    
haoranc's avatar
haoranc 已提交
256
}