Jenkinsfile 4.56 KB
Newer Older
1 2 3 4
pipeline {
  agent any
  stages {
    stage('build') {
5
      parallel {
6

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
        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'
            sh 'git clean -ff -x -d .'
          }
        }

Daniel Agar's avatar
Daniel Agar committed
32
        stage('Linux Debug') {
33 34 35 36 37
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
            QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
          }
Daniel Agar's avatar
Daniel Agar committed
38 39
          agent {
            docker {
40
              image 'mavlink/qgc-build-linux:2018-04-14'
41
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
Daniel Agar's avatar
Daniel Agar committed
42 43 44
            }
          }
          steps {
45
            sh 'export'
46
            sh 'ccache -z'
Daniel Agar's avatar
Daniel Agar committed
47 48 49
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
50 51
            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
52
            sh 'ccache -s'
53
            sh 'git clean -ff -x -d .'
Daniel Agar's avatar
Daniel Agar committed
54 55
          }
        }
56

57
        stage('Linux Release') {
58 59 60 61 62
          environment {
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'release'
            QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
          }
63 64
          agent {
            docker {
65
              image 'mavlink/qgc-build-linux:2018-04-14'
66
              args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
67 68 69
            }
          }
          steps {
70
            sh 'export'
71
            sh 'ccache -z'
72 73 74
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
75 76
            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`'
77
            sh 'ccache -s'
78
            sh 'git clean -ff -x -d .'
79 80
          }
        }
81

82 83 84 85 86 87 88
        stage('OSX Debug') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
89 90 91
            CCACHE_BASEDIR = "${env.WORKSPACE}"
            QGC_CONFIG = 'debug'
            QMAKE_VER = "5.9.3/clang_64/bin/qmake"
92 93
          }
          steps {
94
            sh 'export'
95
            sh 'ccache -z'
96 97 98
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
99 100
            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`'
101
            sh 'ccache -s'
102
            sh 'git clean -ff -x -d .'
103 104
          }
        }
105

106 107 108 109 110 111 112
        stage('OSX Release') {
          agent {
            node {
              label 'mac'
            }
          }
          environment {
113
            CCACHE_BASEDIR = "${env.WORKSPACE}"
114
            QGC_CONFIG = 'installer'
115
            QMAKE_VER = "5.9.3/clang_64/bin/qmake"
116 117
          }
          steps {
118
            sh 'export'
119
            sh 'ccache -z'
120 121 122
            sh 'git submodule deinit -f .'
            sh 'git clean -ff -x -d .'
            sh 'git submodule update --init --recursive --force'
123 124
            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
125
            sh 'ccache -s'
126
            archiveArtifacts(artifacts: 'build/**/*.dmg', fingerprint: true, onlyIfSuccessful: true)
127
            sh 'git clean -ff -x -d .'
128 129
          }
        }
130

131 132 133
      }
    }
  }
134

135
  environment {
PX4 Build Bot's avatar
PX4 Build Bot committed
136
    CCACHE_CPP2 = '1'
137 138
    CCACHE_DIR = '/tmp/ccache'
    QT_FATAL_WARNINGS = '1'
139
  }
140 141 142 143 144 145

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

146
}