Jenkinsfile 4.94 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 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
        stage('Android Release') {
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
            QMAKE_VER = "5.9.2/android_armv7/bin/qmake"
          }
          agent {
            docker {
              image 'mavlink/qgc-build-android:2018-04-14'
              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 41 42
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
            QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
          }
Daniel Agar's avatar
Daniel Agar committed
43 44
          agent {
            docker {
45
              image 'mavlink/qgc-build-linux:2018-04-14'
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
        stage('Linux Release') {
67 68 69 70 71
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
            QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
          }
72 73
          agent {
            docker {
74
              image 'mavlink/qgc-build-linux:2018-04-14'
75
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
76 77 78
            }
          }
          steps {
79
            sh 'export'
80
            sh 'ccache -z'
81 82 83
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
84 85
            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`'
86
            sh 'ccache -s'
87 88 89 90 91
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
92 93
          }
        }
94

95 96 97 98 99 100 101
        stage('OSX Debug') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
102 103 104
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
            QMAKE_VER = "5.9.3/clang_64/bin/qmake"
105 106
          }
          steps {
107
            sh 'export'
108
            sh 'ccache -z'
109 110 111
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
112 113
            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`'
114
            sh 'ccache -s'
115 116 117 118 119
          }
          post {
            cleanup {
              sh 'git clean -ff -x -d .'
            }
120 121
          }
        }
122

123 124 125 126 127 128 129
        stage('OSX Release') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
130
            CCACHE_BASEDIR = "${env.WORKSPACE}"
131
            QGC_CONFIG = 'installer'
132
            QMAKE_VER = "5.9.3/clang_64/bin/qmake"
133 134
          }
          steps {
135
            sh 'export'
136
            sh 'ccache -z'
137 138 139
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
140 141
            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`'
PX4 Build Bot's avatar
PX4 Build Bot committed
142
            sh 'ccache -s'
143 144 145 146 147 148 149 150
          }
          post {
            success {
              archiveArtifacts(artifacts: 'build/**/*.dmg', fingerprint: true)
            }
            cleanup {
              sh 'git clean -ff -x -d .'
            }
151 152
          }
        }
153 154 155
      } // parallel
    } // stage('build')
  } // stages
156

157
  environment {
PX4 Build Bot's avatar
PX4 Build Bot committed
158
    CCACHE_CPP2 = '1'
159 160
    CCACHE_DIR = '/tmp/ccache'
    QT_FATAL_WARNINGS = '1'
161
  }
162 163 164 165 166

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