backup-Jenkinsfile 9.92 KB
Newer Older
1
pipeline {
Anthony Lamping's avatar
Anthony Lamping committed
2
  agent none
3
  stages {
4

5
    stage('build') {
6
      parallel {
7

8
        stage('Android 32 bit Release') {
9 10
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
11
            CCACHE_CPP2 = '1'
12
            QGC_CONFIG = 'release'
13 14 15
            QMAKE_VER = "5.12.5/android_armv7/bin/qmake"
            QT_MKSPEC = "android-clang"
            BITNESS=32
16 17 18
          }
          agent {
            docker {
19
              image 'mavlink/qgc-build-android:2019-11-12'
20 21 22 23 24 25 26 27 28 29 30 31
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
            }
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
            sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
            sh 'cd build; make -j`nproc --all`'
            sh 'ccache -s'
32 33 34 35 36
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
37 38 39
          }
        }

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        stage('Android 64 bit Release') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            CCACHE_CPP2 = '1'
            QGC_CONFIG = 'release'
            QMAKE_VER = "5.12.5/android_arm64_v8a/bin/qmake"
            QT_MKSPEC = "android-clang"
            BITNESS=64
          }
          agent {
            docker {
              image 'mavlink/qgc-build-android_arm64_v8a:2019-11-12'
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
            }
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
            sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
            //sh 'cd build; make -j`nproc --all`' // FIXME
            sh 'ccache -s'
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
          }
        }

Daniel Agar's avatar
Daniel Agar committed
72
        stage('Linux Debug') {
73 74 75
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
76
            QMAKE_VER = "5.12.5/gcc_64/bin/qmake"
77
          }
Daniel Agar's avatar
Daniel Agar committed
78 79
          agent {
            docker {
80
              image 'mavlink/qgc-build-linux:2019-11-12'
81
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
Daniel Agar's avatar
Daniel Agar committed
82 83 84
            }
          }
          steps {
85
            sh 'export'
86
            sh 'ccache -z'
Daniel Agar's avatar
Daniel Agar committed
87 88 89
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
90 91
            sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
            sh 'cd build; make -j`nproc --all`'
Daniel Agar's avatar
Daniel Agar committed
92
            sh 'ccache -s'
93 94 95 96 97
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
Daniel Agar's avatar
Daniel Agar committed
98 99
          }
        }
100

101 102 103 104
        stage('Linux Debug (cmake)') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            CMAKE_BUILD_TYPE = 'Debug'
105
            QT_VERSION = "5.12.5"
106 107 108 109
            QT_MKSPEC = "gcc_64"
          }
          agent {
            docker {
110
              image 'mavlink/qgc-build-linux:2019-11-12'
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
            }
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'make distclean'
            sh 'make submodulesclean'
            sh 'make linux'
            //sh 'make linux check' // TODO: needs Xvfb or similar
            sh 'ccache -s'
            sh 'make distclean'
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
          }
        }

131
        stage('Linux Release') {
132 133 134
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
135
            QMAKE_VER = "5.12.5/gcc_64/bin/qmake"
136
          }
137 138
          agent {
            docker {
139
              image 'mavlink/qgc-build-linux:2019-11-12'
140
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
141 142 143
            }
          }
          steps {
144
            sh 'export'
145
            sh 'ccache -z'
146 147 148
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
149 150 151
            withCredentials([file(credentialsId: 'QGC_Airmap_api_key', variable: 'AIRMAP_API_HEADER')]) {
              sh 'cp $AIRMAP_API_HEADER ${WORKSPACE}/src/Airmap/Airmap_api_key.h'
            }
152
            sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
153 154
            //sh 'cd build; make -j`nproc --all`' // TODO: increase slave memory
            sh 'cd build; make'
155
            sh 'ccache -s'
156 157 158 159 160
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
161 162
          }
        }
163

164 165 166 167
        stage('Linux Release (cmake)') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            CMAKE_BUILD_TYPE = 'Release'
168
            QT_VERSION = "5.12.5"
169 170 171 172
            QT_MKSPEC = "gcc_64"
          }
          agent {
            docker {
173
              image 'mavlink/qgc-build-linux:2019-11-12'
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
            }
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'make distclean'
            sh 'make submodulesclean'
            sh 'make linux'
            sh 'ccache -s'
            sh 'make distclean'
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
          }
        }

193 194 195 196 197 198 199
        stage('OSX Debug') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
200 201
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
202
            QMAKE_VER = "5.11.0/clang_64/bin/qmake"
203 204
          }
          steps {
205
            sh 'export'
206
            sh 'ccache -z'
207 208 209
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
210 211
            sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
            sh 'cd build; make -j`sysctl -n hw.ncpu`'
212
            sh 'ccache -s'
213 214 215 216 217
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
218 219
          }
        }
220

221 222 223 224 225 226 227 228
        stage('OSX Debug (cmake)') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
229
            CCACHE_CPP2 = '1'
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
            CMAKE_BUILD_TYPE = 'Debug'
            QT_VERSION = "5.11.0"
            QT_MKSPEC = "clang_64"
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'make distclean'
            sh 'make submodulesclean'
            sh 'make mac'
            sh 'ccache -s'
            sh 'make distclean'
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
          }
        }

250 251 252 253 254 255 256
        stage('OSX Release') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
257
            CCACHE_BASEDIR = "${env.WORKSPACE}"
258
            CCACHE_CPP2 = '1'
259
            QGC_CONFIG = 'installer'
260
            QMAKE_VER = "5.11.0/clang_64/bin/qmake"
261
          }
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
          stages {
            stage('Clean Checkout') {
              steps {
                sh 'export'
                sh 'ccache -z'
                sh 'git submodule deinit -f .'
                sh 'git clean -ff -x -d .'
                sh 'git submodule update --init --recursive --force'
              }
            }

            stage('Add Airmap API key') {
              steps {
                withCredentials([file(credentialsId: 'QGC_Airmap_api_key', variable: 'AIRMAP_API_HEADER')]) {
                  sh 'cp $AIRMAP_API_HEADER ${WORKSPACE}/src/Airmap/Airmap_api_key.h'
                }
              }
              when {
                anyOf {
                  branch 'master';
                  branch 'Stable_*'
                }
              }
            }

            stage('Build OSX Release') {
              steps {
                sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
                sh 'cd build; make -j`sysctl -n hw.ncpu`'
                archiveArtifacts(artifacts: 'build/**/*.dmg', fingerprint: true)
                sh 'ccache -s'
              }
            }
295 296 297 298 299
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
300 301
          }
        }
302

303 304 305 306 307 308 309 310
        stage('OSX Release (cmake)') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
311
            CCACHE_CPP2 = '1'
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
            CMAKE_BUILD_TYPE = 'Release'
            QT_VERSION = "5.11.0"
            QT_MKSPEC = "clang_64"
          }
          steps {
            sh 'export'
            sh 'ccache -z'
            sh 'make distclean'
            sh 'make submodulesclean'
            sh 'make mac'
            sh 'ccache -s'
            sh 'make distclean'
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
          }
        }

332 333 334
      } // parallel
    } // stage('build')
  } // stages
335

336
  environment {
337 338
    CCACHE_DIR = '/tmp/ccache'
    QT_FATAL_WARNINGS = '1'
339
  }
340 341 342 343 344

  options {
    buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
    timeout(time: 60, unit: 'MINUTES')
  }
345
}