mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 16:17:35 +08:00
Jenkins create PX4/Firmware test branch and push (#436)
This commit is contained in:
Vendored
+50
-23
@@ -5,14 +5,14 @@ pipeline {
|
|||||||
parallel {
|
parallel {
|
||||||
|
|
||||||
stage('Linux GCC') {
|
stage('Linux GCC') {
|
||||||
environment {
|
|
||||||
CCACHE_BASEDIR = "${env.WORKSPACE}"
|
|
||||||
}
|
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-base:2017-12-30'
|
image 'px4io/px4-dev-base:2017-12-30'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
CCACHE_BASEDIR = "${env.WORKSPACE}"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'export'
|
sh 'export'
|
||||||
@@ -25,17 +25,17 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Linux Clang') {
|
stage('Linux Clang') {
|
||||||
environment {
|
|
||||||
CCACHE_BASEDIR = "${env.WORKSPACE}"
|
|
||||||
CC = 'clang'
|
|
||||||
CXX = 'clang++'
|
|
||||||
}
|
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-clang:2017-12-30'
|
image 'px4io/px4-dev-clang:2017-12-30'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
environment {
|
||||||
|
CCACHE_BASEDIR = "${env.WORKSPACE}"
|
||||||
|
CC = 'clang'
|
||||||
|
CXX = 'clang++'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'export'
|
sh 'export'
|
||||||
sh 'ccache -z'
|
sh 'ccache -z'
|
||||||
@@ -113,7 +113,7 @@ pipeline {
|
|||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
sh 'make test_EKF'
|
sh 'make test_EKF'
|
||||||
sh 'ccache -s'
|
sh 'ccache -s'
|
||||||
archiveArtifacts(artifacts: 'build/test_build/*.pdf')
|
archiveArtifacts 'build/test_build/*.pdf'
|
||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,24 +148,51 @@ pipeline {
|
|||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
//sh 'make doxygen'
|
//sh 'make doxygen'
|
||||||
sh 'ccache -s'
|
sh 'ccache -s'
|
||||||
// publish html
|
publishHTML([
|
||||||
publishHTML target: [
|
reportTitles: 'Doxygen',
|
||||||
reportTitles: 'Doxygen',
|
allowMissing: true,
|
||||||
allowMissing: true,
|
alwaysLinkToLastBuild: true,
|
||||||
alwaysLinkToLastBuild: true,
|
keepAll: true,
|
||||||
keepAll: true,
|
reportDir: 'build/doxygen/Documentation',
|
||||||
reportDir: 'build/doxygen/Documentation',
|
reportFiles: '*',
|
||||||
reportFiles: '*',
|
reportName: 'doxygen'
|
||||||
reportName: 'doxygen'
|
])
|
||||||
]
|
|
||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // parallel
|
stage('PX4/Firmware build') {
|
||||||
}
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'px4io/px4-dev-base:2018-03-30'
|
||||||
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
PX4_FIRMWARE_TEST_BRANCH = "ecl_${env.JOB_BASE_NAME}"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'export'
|
||||||
|
sh('git config user.email "bot@pixhawk.org"')
|
||||||
|
sh('git config user.name "PX4BuildBot"')
|
||||||
|
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||||
|
sh('git clone --branch master --origin px4 https://${GIT_USER}:${GIT_PASS}@github.com/PX4/Firmware.git')
|
||||||
|
}
|
||||||
|
sh('cd Firmware; git checkout -B ${PX4_FIRMWARE_TEST_BRANCH}')
|
||||||
|
sh('if [ -n "${CHANGE_FORK+set}" ]; then cd Firmware; git config --file=.gitmodules submodule."src/lib/ecl".url https://github.com/${CHANGE_FORK}/ecl.git; fi')
|
||||||
|
sh('cd Firmware; git submodule sync')
|
||||||
|
sh('cd Firmware; git submodule update --init --recursive --force src/lib/ecl')
|
||||||
|
sh 'cd Firmware/src/lib/ecl; git fetch --all --tags; git checkout -f ${GIT_COMMIT}'
|
||||||
|
sh('cd Firmware; git commit -a -m "PX4/ecl test `date` ${GIT_BRANCH} ${GIT_COMMIT}"')
|
||||||
|
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||||
|
sh('cd Firmware; git push --force px4 ${PX4_FIRMWARE_TEST_BRANCH}')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
} // parallel
|
||||||
|
} // stage Test
|
||||||
|
} // stages
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
CCACHE_DIR = '/tmp/ccache'
|
CCACHE_DIR = '/tmp/ccache'
|
||||||
|
|||||||
Reference in New Issue
Block a user