Jenkinsfile 8.64 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 9 10 11
        stage('Android Release') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
12
            QMAKE_VER = "5.11.0/android_armv7/bin/qmake"
13 14 15
          }
          agent {
            docker {
16
              image 'mavlink/qgc-build-android:2019-02-03'
17 18 19 20 21 22 23 24 25 26 27 28
              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'
29 30 31 32 33
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
34 35 36
          }
        }

Daniel Agar's avatar
Daniel Agar committed
37
        stage('Linux Debug') {
38 39 40
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
41
            QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
42
          }
Daniel Agar's avatar
Daniel Agar committed
43 44
          agent {
            docker {
45
              image 'mavlink/qgc-build-linux:2019-02-03'
46
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
Daniel Agar's avatar
Daniel Agar committed
47 48 49
            }
          }
          steps {
50
            sh 'export'
51
            sh 'ccache -z'
Daniel Agar's avatar
Daniel Agar committed
52 53 54
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
55 56
            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
57
            sh 'ccache -s'
58 59 60 61 62
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
Daniel Agar's avatar
Daniel Agar committed
63 64
          }
        }
65

66 67 68 69 70 71 72 73 74
        stage('Linux Debug (cmake)') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            CMAKE_BUILD_TYPE = 'Debug'
            QT_VERSION = "5.11.0"
            QT_MKSPEC = "gcc_64"
          }
          agent {
            docker {
75
              image 'mavlink/qgc-build-linux:2019-02-03'
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
              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 .'
            }
          }
        }

96
        stage('Linux Release') {
97 98 99
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
100
            QMAKE_VER = "5.11.0/gcc_64/bin/qmake"
101
          }
102 103
          agent {
            docker {
104
              image 'mavlink/qgc-build-linux:2019-02-03'
105
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
106 107 108
            }
          }
          steps {
109
            sh 'export'
110
            sh 'ccache -z'
111 112 113
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
114 115 116
            withCredentials([file(credentialsId: 'QGC_Airmap_api_key', variable: 'AIRMAP_API_HEADER')]) {
              sh 'cp $AIRMAP_API_HEADER ${WORKSPACE}/src/Airmap/Airmap_api_key.h'
            }
117 118
            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`'
119
            sh 'ccache -s'
120 121 122 123 124
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
125 126
          }
        }
127

128 129 130 131 132 133 134 135 136
        stage('Linux Release (cmake)') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            CMAKE_BUILD_TYPE = 'Release'
            QT_VERSION = "5.11.0"
            QT_MKSPEC = "gcc_64"
          }
          agent {
            docker {
137
              image 'mavlink/qgc-build-linux:2019-02-03'
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
              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 .'
            }
          }
        }

157 158 159 160 161 162 163
        stage('OSX Debug') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
164 165
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
166
            QMAKE_VER = "5.11.0/clang_64/bin/qmake"
167 168
          }
          steps {
169
            sh 'export'
170
            sh 'ccache -z'
171 172 173
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
174 175
            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`'
176
            sh 'ccache -s'
177 178 179 180 181
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
182 183
          }
        }
184

185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
        stage('OSX Debug (cmake)') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            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 .'
            }
          }
        }

213 214 215 216 217 218 219
        stage('OSX Release') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
220
            CCACHE_BASEDIR = "${env.WORKSPACE}"
221
            QGC_CONFIG = 'installer'
222
            QMAKE_VER = "5.11.0/clang_64/bin/qmake"
223
          }
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
          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'
              }
            }
257 258 259 260 261
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
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
        stage('OSX Release (cmake)') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            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 .'
            }
          }
        }

293 294 295
      } // parallel
    } // stage('build')
  } // stages
296

297
  environment {
PX4 Build Bot's avatar
PX4 Build Bot committed
298
    CCACHE_CPP2 = '1'
299 300
    CCACHE_DIR = '/tmp/ccache'
    QT_FATAL_WARNINGS = '1'
301
  }
302 303 304 305 306

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