MPtestJenkinsfile 10.3 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 11 12 13 14 15 16 17
        echo ''' + branch_name + '''
    '''
    sh '''
        cd ${TDINTERNAL_ROOT_DIR}
        git reset --hard
        git fetch || git fetch
        git checkout ''' + branch_name + ''' -f
        git branch
        git pull || git pull
        git log | head -n 20
        cd ${TDENGINE_ROOT_DIR}
        git reset --hard
        git fetch || git fetch
haoranc's avatar
haoranc 已提交
18
        rm -rf examples/rust/
haoranc's avatar
haoranc 已提交
19 20 21 22 23 24 25 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 51 52 53 54 55 56
        git checkout ''' + branch_name + ''' -f
        git branch
        git pull || git pull
        git log | head -n 20
        git submodule update --init --recursive
    '''
    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 {
        string (
            name:'version', 
            defaultValue:'3.0.0.1', 
            description: 'release version number,eg: 3.0.0.1 or 3.0.0.'
        )
        string (
            name:'baseVersion', 
            defaultValue:'3.0.0.1', 
            description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
        )
haoranc's avatar
haoranc 已提交
57 58 59 60 61 62 63 64 65 66
        string (
            name:'toolsVersion', 
            defaultValue:'2.1.2', 
            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'
        )
67 68 69 70 71
        string (
            name:'nasPassword', 
            defaultValue:'password', 
            description: 'the pasword of the NAS server which has installPackage-192.168.1.131'
        )
haoranc's avatar
haoranc 已提交
72 73 74 75 76 77 78 79
    }
    environment{
        WORK_DIR = '/var/lib/jenkins/workspace'
        TDINTERNAL_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal'
        TDENGINE_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal/community'
        BRANCH_NAME = '3.0'

        TD_SERVER_TAR = "TDengine-server-${version}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
80
        BASE_TD_SERVER_TAR = "TDengine-server-${baseVersion}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
81 82 83 84 85 86 87 88

        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 已提交
89
        BASE_TD_CLIENT_TAR = "TDengine-client-${baseVersion}-Linux-x64.tar.gz"
haoranc's avatar
haoranc 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104

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

haoranc's avatar
haoranc 已提交
107 108 109 110 111 112 113 114

    }
    stages {
        stage ('RUN') {
            parallel {
                stage('ubuntu16') {
                    agent{label " ubuntu16 "}
                    steps {
haoranc's avatar
haoranc 已提交
115
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
116
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
117 118
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
119
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
120 121 122 123
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
124
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
125 126 127 128
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
129
                            bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
130 131 132 133 134 135 136 137
                            python3 checkPackageRuning.py  
                            '''
                        }
                    }
                }
                stage('ubuntu18') {
                    agent{label " ubuntu18 "}
                    steps {
haoranc's avatar
haoranc 已提交
138
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
139
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
140 141
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
142 143 144 145 146 147
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
148 149 150 151
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
haoranc's avatar
haoranc 已提交
152
                            bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword} 
haoranc's avatar
haoranc 已提交
153 154 155 156
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
157
                            bash testpackage.sh ${TD_CLIENT_TAR} ${version} ${BASE_TD_CLIENT_TAR} ${baseVersion} client ${nasPassword}
haoranc's avatar
haoranc 已提交
158 159 160 161 162 163 164 165
                            python3 checkPackageRuning.py  
                            '''
                        }
                    }
                }
                stage('centos7') {
                    agent{label " centos7_9 "}
                    steps {
haoranc's avatar
haoranc 已提交
166
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
167
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
168 169
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
170
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
171 172 173 174
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
175
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
176 177 178 179
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
180
                            bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
181 182 183 184 185 186 187 188
                            python3 checkPackageRuning.py  
                            '''
                        }
                    }
                }
                stage('centos8') {
                    agent{label " centos8_3 "}
                    steps {
haoranc's avatar
haoranc 已提交
189
                        timeout(time: 30, unit: 'MINUTES'){
haoranc's avatar
haoranc 已提交
190
                            sync_source("${BRANCH_NAME}")
haoranc's avatar
haoranc 已提交
191
                            sh '''
192 193 194 195 196
                            cd ${TDENGINE_ROOT_DIR}/packaging 
                            bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword} 
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
haoranc's avatar
haoranc 已提交
197
                            cd ${TDENGINE_ROOT_DIR}/packaging
198
                            bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
199 200 201 202
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
                            bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${nasPassword}
                            python3 checkPackageRuning.py  
                            '''            
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh ${TD_CLIENT_LITE_TAR} ${version} ${BASE_TD_CLIENT_LITE_TAR} ${baseVersion} client ${nasPassword}
                            python3 checkPackageRuning.py  
                            '''         
                        }
                    }
                }
                                    
                stage('arm64') {
                    agent{label 'linux_arm64'}
                    steps {
                        timeout(time: 30, unit: 'MINUTES'){
                            sync_source("${BRANCH_NAME}")
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
                            bash testpackage.sh ${TD_SERVER_ARM_TAR} ${version} ${BASE_TD_SERVER_ARM_TAR} ${baseVersion} server ${nasPassword}
haoranc's avatar
haoranc 已提交
223 224 225 226
                            python3 checkPackageRuning.py  
                            '''
                            sh '''
                            cd ${TDENGINE_ROOT_DIR}/packaging
227
                            bash testpackage.sh ${TD_CLIENT_ARM_TAR} ${version} ${BASE_TD_CLIENT_ARM_TAR} ${baseVersion} client  ${nasPassword}
haoranc's avatar
haoranc 已提交
228 229 230 231 232 233 234 235 236
                            python3 checkPackageRuning.py  
                            '''                     
                        }
                    }
                }
            }
        }
    }
}