2018-10-24 09:10:22 +03:00
|
|
|
|
pipeline {
|
|
|
|
|
agent {
|
2018-10-29 06:08:19 +02:00
|
|
|
|
// docker { image 'ros:kinetic-ros-base-xenial' }
|
|
|
|
|
docker { image 'joinaero/kinetic-ros-opencv-xenial' }
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-24 11:47:29 +03:00
|
|
|
|
/*
|
|
|
|
|
environment {
|
|
|
|
|
// FindOpenCV.cmake
|
|
|
|
|
OpenCV_DIR = '/opt/ros/kinetic/share/OpenCV-3.3.1-dev'
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
2018-10-24 09:10:22 +03:00
|
|
|
|
stages {
|
|
|
|
|
stage('Prepare') {
|
|
|
|
|
steps {
|
2018-10-24 11:47:29 +03:00
|
|
|
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
2018-10-24 09:10:22 +03:00
|
|
|
|
echo 'apt-get ..'
|
2018-10-29 06:08:19 +02:00
|
|
|
|
sh 'apt-get update'
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Init') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make init ..'
|
|
|
|
|
sh 'make init INIT_OPTIONS=-y'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
// echo 'skip get submodules and make test'
|
|
|
|
|
// sh './scripts/init.sh -y'
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Build') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make build ..'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
sh '. /opt/ros/kinetic/setup.sh; make build'
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Install') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make install ..'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
sh '. /opt/ros/kinetic/setup.sh; make install SUDO='
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Test') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make test ..'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
sh '. /opt/ros/kinetic/setup.sh; make test SUDO='
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Samples') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make samples ..'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
sh '. /opt/ros/kinetic/setup.sh; make samples SUDO='
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Tools') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make tools ..'
|
2018-10-24 11:47:29 +03:00
|
|
|
|
sh '. /opt/ros/kinetic/setup.sh; make tools SUDO='
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('ROS') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'make ros ..'
|
|
|
|
|
sh '''
|
2018-10-24 11:47:29 +03:00
|
|
|
|
. /opt/ros/kinetic/setup.sh
|
2018-10-24 09:10:22 +03:00
|
|
|
|
rosdep install --from-paths wrappers/ros/src --ignore-src --rosdistro kinetic -y
|
|
|
|
|
make ros SUDO=
|
|
|
|
|
'''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
stage('Clean') {
|
|
|
|
|
steps {
|
|
|
|
|
echo 'clean ..'
|
|
|
|
|
sh '''
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
'''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
post {
|
|
|
|
|
always {
|
|
|
|
|
echo 'This will always run'
|
|
|
|
|
}
|
|
|
|
|
success {
|
|
|
|
|
echo 'This will run only if successful'
|
|
|
|
|
}
|
|
|
|
|
failure {
|
|
|
|
|
echo 'This will run only if failed'
|
2019-08-23 10:43:40 +03:00
|
|
|
|
// mail to: 'mynteye-ci@slightech.com',
|
|
|
|
|
mail to: 'cocowang@slightech.com',
|
2019-08-23 10:16:44 +03:00
|
|
|
|
subject: "编译失败 Failed Pipeline: ${currentBuild.fullDisplayName}",
|
2019-08-23 10:43:40 +03:00
|
|
|
|
body: """
|
|
|
|
|
详情:
|
|
|
|
|
FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'
|
|
|
|
|
状态:${env.JOB_NAME} jenkins 运行失败
|
|
|
|
|
URL :${env.BUILD_URL}
|
|
|
|
|
项目名称 :${env.JOB_NAME}
|
|
|
|
|
项目更新进度:${env.BUILD_NUMBER}
|
|
|
|
|
"""
|
2018-10-24 09:10:22 +03:00
|
|
|
|
}
|
|
|
|
|
unstable {
|
|
|
|
|
echo 'This will run only if the run was marked as unstable'
|
|
|
|
|
}
|
|
|
|
|
changed {
|
|
|
|
|
echo 'This will run only if the state of the Pipeline has changed'
|
|
|
|
|
echo 'For example, if the Pipeline was previously failing but is now successful'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|