chore(*): modify jenkinsfile

This commit is contained in:
wangruixue 2019-08-26 18:15:37 +08:00 committed by TinyO
parent 92e973f563
commit 5ecd4be222

39
Jenkinsfile vendored
View File

@ -16,7 +16,10 @@ pipeline {
steps {
echo "WORKSPACE: ${env.WORKSPACE}"
echo 'apt-get ..'
sh 'apt-get update'
sh '''
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
'''
}
}
stage('Init') {
@ -39,12 +42,7 @@ pipeline {
sh '. /opt/ros/kinetic/setup.sh; make install SUDO='
}
}
stage('Test') {
steps {
echo 'make test ..'
sh '. /opt/ros/kinetic/setup.sh; make test SUDO='
}
}
stage('Samples') {
steps {
echo 'make samples ..'
@ -82,29 +80,34 @@ pipeline {
post {
always {
echo 'This will always run'
dingTalk accessToken: '7dca6ae9b1b159b8b4b375e858b71f2e6cec8f73fa20d07552d09791261b2344',
imageUrl: 'http://icon-park.com/imagefiles/loading7_gray.gif',
message: '开始构建',
jenkinsUrl: "${JENKINS_URL}"
}
success {
echo 'This will run only if successful'
dingTalk accessToken: '7dca6ae9b1b159b8b4b375e858b71f2e6cec8f73fa20d07552d09791261b2344',
imageUrl: 'http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png',
message: '构建成功',
jenkinsUrl: "${JENKINS_URL}"
}
failure {
echo 'This will run only if failed'
mail to: 'mynteye-ci@slightech.com',
subject: "${env.JOB_NAME} 编译失败 Failed Pipeline: ${currentBuild.fullDisplayName}",
body: """
详情:
FAILED : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'
状态 ${env.JOB_NAME} jenkins 运行失败
URL ${env.BUILD_URL}
项目名称 ${env.JOB_NAME}
项目更新进度 ${env.BUILD_NUMBER}
"""
dingTalk accessToken: '7dca6ae9b1b159b8b4b375e858b71f2e6cec8f73fa20d07552d09791261b2344',
imageUrl: 'http://www.iconsdb.com/icons/preview/soylent-red/x-mark-3-xxl.png',
message: '构建失败',
jenkinsUrl: "${JENKINS_URL}"
}
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'
echo 'For example, if the Pipeline was previously failing but is now successful11'
}
}
}