Commit 3c36e26a authored by Daniel Agar's avatar Daniel Agar

Jenkins organize environment sections

parent 04e0dce3
...@@ -4,36 +4,48 @@ pipeline { ...@@ -4,36 +4,48 @@ pipeline {
stage('build') { stage('build') {
parallel { parallel {
stage('Linux Debug') { stage('Linux Debug') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'debug'
QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
}
agent { agent {
docker { docker {
image 'mavlink/qgc-build-linux' image 'mavlink/qgc-build-linux'
args '-e CI=true -e CCACHE_BASEDIR=$WORKSPACE -e CCACHE_DIR=/tmp/ccache -v /tmp/ccache:/tmp/ccache:rw' args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
} }
} }
steps { steps {
sh 'export'
sh 'ccache -z' sh 'ccache -z'
sh 'git submodule deinit -f .' sh 'git submodule deinit -f .'
sh 'git clean -ff -x -d .' sh 'git clean -ff -x -d .'
sh 'git submodule update --init --recursive --force' sh 'git submodule update --init --recursive --force'
sh 'mkdir build; cd build; qmake -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=debug CONFIG+=WarningsAsErrorsOn' sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
sh 'cd build; make -j4' sh 'cd build; make -j`nproc --all`'
sh 'ccache -s' sh 'ccache -s'
} }
} }
stage('Linux Release') { stage('Linux Release') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
QGC_CONFIG = 'release'
QMAKE_VER = "5.9.2/gcc_64/bin/qmake"
}
agent { agent {
docker { docker {
image 'mavlink/qgc-build-linux' image 'mavlink/qgc-build-linux'
args '-e CI=true -e CCACHE_BASEDIR=$WORKSPACE -e CCACHE_DIR=/tmp/ccache -v /tmp/ccache:/tmp/ccache:rw' args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
} }
} }
steps { steps {
sh 'export'
sh 'ccache -z' sh 'ccache -z'
sh 'git submodule deinit -f .' sh 'git submodule deinit -f .'
sh 'git clean -ff -x -d .' sh 'git clean -ff -x -d .'
sh 'git submodule update --init --recursive --force' sh 'git submodule update --init --recursive --force'
sh 'mkdir build; cd build; qmake -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=release CONFIG+=WarningsAsErrorsOn' sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
sh 'cd build; make -j4' sh 'cd build; make -j`nproc --all`'
sh 'ccache -s' sh 'ccache -s'
} }
} }
...@@ -44,17 +56,18 @@ pipeline { ...@@ -44,17 +56,18 @@ pipeline {
} }
} }
environment { environment {
QT_FATAL_WARNINGS = '1' CCACHE_BASEDIR = "${env.WORKSPACE}"
QMAKESPEC = 'macx-clang' QGC_CONFIG = 'debug'
QMAKE_VER = "5.9.3/clang_64/bin/qmake"
} }
steps { steps {
sh 'export'
sh 'ccache -z' sh 'ccache -z'
sh 'git submodule deinit -f .' sh 'git submodule deinit -f .'
sh 'git clean -ff -x -d .' sh 'git clean -ff -x -d .'
sh 'git submodule update --init --recursive --force' sh 'git submodule update --init --recursive --force'
sh 'rm -rf ${SHADOW_BUILD_DIR}; mkdir -p ${SHADOW_BUILD_DIR}' sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
sh 'cd ${SHADOW_BUILD_DIR}; ${QT_PATH}/5.9.3/clang_64/bin/qmake -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=debug CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`sysctl -n hw.ncpu`'
sh 'cd ${SHADOW_BUILD_DIR}; make -j`sysctl -n hw.ncpu`'
sh 'ccache -s' sh 'ccache -s'
} }
} }
...@@ -65,17 +78,18 @@ pipeline { ...@@ -65,17 +78,18 @@ pipeline {
} }
} }
environment { environment {
QT_FATAL_WARNINGS = '1' CCACHE_BASEDIR = "${env.WORKSPACE}"
QMAKESPEC = 'macx-clang' QGC_CONFIG = 'release'
QMAKE_VER = "5.9.3/clang_64/bin/qmake"
} }
steps { steps {
sh 'export'
sh 'ccache -z' sh 'ccache -z'
sh 'git submodule deinit -f .' sh 'git submodule deinit -f .'
sh 'git clean -ff -x -d .' sh 'git clean -ff -x -d .'
sh 'git submodule update --init --recursive --force' sh 'git submodule update --init --recursive --force'
sh 'rm -rf ${SHADOW_BUILD_DIR}; mkdir -p ${SHADOW_BUILD_DIR}' sh 'mkdir build; cd build; ${QT_PATH}/${QMAKE_VER} -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=${QGC_CONFIG} CONFIG+=WarningsAsErrorsOn'
sh 'cd ${SHADOW_BUILD_DIR}; ${QT_PATH}/5.9.3/clang_64/bin/qmake -r ${WORKSPACE}/qgroundcontrol.pro CONFIG+=release CONFIG+=WarningsAsErrorsOn' sh 'cd build; make -j`sysctl -n hw.ncpu`'
sh 'cd ${SHADOW_BUILD_DIR}; make -j`sysctl -n hw.ncpu`'
sh 'ccache -s' sh 'ccache -s'
} }
} }
...@@ -83,8 +97,8 @@ pipeline { ...@@ -83,8 +97,8 @@ pipeline {
} }
} }
environment { environment {
SHADOW_BUILD_DIR = '/tmp/jenkins/shadow_build_dir'
CCACHE_CPP2 = '1' CCACHE_CPP2 = '1'
CCACHE_BASEDIR = '${WORKSPACE}' CCACHE_DIR = '/tmp/ccache'
QT_FATAL_WARNINGS = '1'
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment