blob: ece93fca8f2d030998de39e459eaa121d4d1ecc5 [file] [log] [blame]
Oleg Polyakov4d454362018-06-15 10:52:52 -04001/* voltha-atest-provisioning pipeline */
2
3pipeline {
4
5 /* no label, executor is determined by JJB */
6 agent {
7 label "${params.executorNode}"
8 }
9
10 stages {
11
Kailash Khalasicdb46672018-10-30 12:55:16 -070012 stage ('Clean up') {
13 steps {
14 sh '''
Kailashb30eb042019-01-23 12:14:10 -080015 sudo rm -rf *
Kailashe51b6372018-11-16 11:38:13 -080016 sudo rm -rf /home/cord/cord*
Kailash Khalasicdb46672018-10-30 12:55:16 -070017 '''
18 }
19 }
20
21 stage('Voltha Repo') {
Oleg Polyakov9e76f5d2018-06-18 17:21:33 -040022 steps {
23 checkout(changelog: false, \
24 poll: false,
25 scm: [$class: 'RepoScm', \
26 manifestRepositoryUrl: "${params.manifestUrl}", \
27 manifestBranch: "${params.manifestBranch}", \
28 currentBranch: true, \
29 destinationDir: 'cord', \
30 forceSync: true,
31 resetFirst: true, \
32 quiet: true, \
33 jobs: 4, \
34 showAllChanges: true] \
35 )
36 }
37 }
38
Kailash Khalasicdb46672018-10-30 12:55:16 -070039 stage ('Build Voltha and ONOS') {
Oleg Polyakov9e76f5d2018-06-18 17:21:33 -040040 steps {
Oleg Polyakovd9de9032018-06-28 11:42:32 -040041 sh '''
Kailash Khalasiaa35cd32018-11-12 12:30:08 -080042 sudo service docker restart
Oleg Polyakovd9de9032018-06-28 11:42:32 -040043 cd $WORKSPACE/cord/incubator/voltha
Kailashaca74b92018-11-16 10:55:47 -080044 repo download voltha "${gerritChangeNumber}/${gerritPatchsetNumber}"
Kailash Khalasicdb46672018-10-30 12:55:16 -070045 chmod +x env.sh
Oleg Polyakovd9de9032018-06-28 11:42:32 -040046 source env.sh
Kailash Khalasif0720122018-11-08 10:18:24 -080047 make fetch
48 make clean
49 make build
Oleg Polyakovd9de9032018-06-28 11:42:32 -040050 '''
51 }
52 }
Oleg Polyakov9e76f5d2018-06-18 17:21:33 -040053
Kailashb30eb042019-01-23 12:14:10 -080054 stage ('Start Voltha Test Suite') {
Oleg Polyakov4d454362018-06-15 10:52:52 -040055 steps {
Kailash Khalasicdb46672018-10-30 12:55:16 -070056 sh '''
57 cd $WORKSPACE/cord/incubator/voltha/tests/atests/common/
Kailash3bba5fe2018-11-06 10:48:25 -080058 ./run_robot.sh jenkinstest || true
Kailash Khalasicdb46672018-10-30 12:55:16 -070059 '''
Oleg Polyakov4d454362018-06-15 10:52:52 -040060 }
61 }
Kailash Khalasicdb46672018-10-30 12:55:16 -070062
63 stage('Publish') {
64 steps {
65 sh """
66 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
67 cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/ ./RobotLogs
Kailash3bba5fe2018-11-06 10:48:25 -080068 cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/voltha_test_results/*.log $WORKSPACE/
Kailash Khalasicdb46672018-10-30 12:55:16 -070069 """
70
71 step([$class: 'RobotPublisher',
72 disableArchiveOutput: false,
Kailash3bba5fe2018-11-06 10:48:25 -080073 logFileName: 'RobotLogs/jenkinstest/log*.html',
Kailash Khalasicdb46672018-10-30 12:55:16 -070074 otherFiles: '',
Kailash3bba5fe2018-11-06 10:48:25 -080075 outputFileName: 'RobotLogs/jenkinstest/output*.xml',
Kailash Khalasicdb46672018-10-30 12:55:16 -070076 outputPath: '.',
77 passThreshold: 100,
Kailash3bba5fe2018-11-06 10:48:25 -080078 reportFileName: 'RobotLogs/jenkinstest/report*.html',
Kailash Khalasicdb46672018-10-30 12:55:16 -070079 unstableThreshold: 0]);
80 }
81 }
Kailash45b2e8d2018-11-05 09:17:00 -080082 }
Kailash Khalasicdb46672018-10-30 12:55:16 -070083
Kailash45b2e8d2018-11-05 09:17:00 -080084 post {
85 always {
Kailash45b2e8d2018-11-05 09:17:00 -080086 archiveArtifacts artifacts: '*.log'
87 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "gdepatie@northforgeinc.com, kailash@opennetworking.org", sendToIndividuals: false])
88 }
Oleg Polyakovd9de9032018-06-28 11:42:32 -040089 }
Oleg Polyakov4d454362018-06-15 10:52:52 -040090}
Kailash Khalasicdb46672018-10-30 12:55:16 -070091
92