blob: de7ef0b60baaf0991c6e0afc91bf71d8fcbfce19 [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') {
Kailash74eed212019-05-07 09:57:59 -070040 when { expression { return params.BuildVoltha } }
Oleg Polyakov9e76f5d2018-06-18 17:21:33 -040041 steps {
Oleg Polyakovd9de9032018-06-28 11:42:32 -040042 sh '''
Kailash Khalasiaa35cd32018-11-12 12:30:08 -080043 sudo service docker restart
Oleg Polyakovd9de9032018-06-28 11:42:32 -040044 cd $WORKSPACE/cord/incubator/voltha
Kailashc24db752019-05-07 14:01:40 -070045 repo download "${GERRIT_PROJECT}" "${gerritChangeNumber}/${gerritPatchsetNumber}"
Kailash Khalasicdb46672018-10-30 12:55:16 -070046 chmod +x env.sh
Oleg Polyakovd9de9032018-06-28 11:42:32 -040047 source env.sh
Kailash Khalasif0720122018-11-08 10:18:24 -080048 make fetch
49 make clean
50 make build
Oleg Polyakovd9de9032018-06-28 11:42:32 -040051 '''
52 }
53 }
Oleg Polyakov9e76f5d2018-06-18 17:21:33 -040054
Kailash74eed212019-05-07 09:57:59 -070055 stage ('Build BBSIM') {
56 when { expression { return params.BuildBbsim } }
57 steps {
58 sh '''
59 sudo service docker restart
60 cd $WORKSPACE/cord/incubator/voltha-bbsim
Kailash3ae26172019-05-08 11:12:21 -070061 repo download "${GERRIT_PROJECT}" "${gerritChangeNumber}/${gerritPatchsetNumber}"
Kailash22aa1cf2019-08-08 10:06:57 -070062 make DOCKER_TAG=latest docker-build
Kailash74eed212019-05-07 09:57:59 -070063 docker images | grep bbsim
64 '''
65 }
66 }
67
Kailashb30eb042019-01-23 12:14:10 -080068 stage ('Start Voltha Test Suite') {
Oleg Polyakov4d454362018-06-15 10:52:52 -040069 steps {
Kailash4a4f0472019-05-08 09:42:46 -070070 sh """
Kailash Khalasicdb46672018-10-30 12:55:16 -070071 cd $WORKSPACE/cord/incubator/voltha/tests/atests/common/
Kailash74eed212019-05-07 09:57:59 -070072 ./run_robot.sh jenkinstest ${params.adapter} || true
Kailash4a4f0472019-05-08 09:42:46 -070073 """
Oleg Polyakov4d454362018-06-15 10:52:52 -040074 }
75 }
Kailash Khalasicdb46672018-10-30 12:55:16 -070076
77 stage('Publish') {
78 steps {
79 sh """
80 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
81 cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/ ./RobotLogs
Kailash3bba5fe2018-11-06 10:48:25 -080082 cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/voltha_test_results/*.log $WORKSPACE/
Kailash Khalasicdb46672018-10-30 12:55:16 -070083 """
84
85 step([$class: 'RobotPublisher',
86 disableArchiveOutput: false,
Kailash3bba5fe2018-11-06 10:48:25 -080087 logFileName: 'RobotLogs/jenkinstest/log*.html',
Kailash Khalasicdb46672018-10-30 12:55:16 -070088 otherFiles: '',
Kailash3bba5fe2018-11-06 10:48:25 -080089 outputFileName: 'RobotLogs/jenkinstest/output*.xml',
Kailash Khalasicdb46672018-10-30 12:55:16 -070090 outputPath: '.',
91 passThreshold: 100,
Kailash3bba5fe2018-11-06 10:48:25 -080092 reportFileName: 'RobotLogs/jenkinstest/report*.html',
Kailash Khalasicdb46672018-10-30 12:55:16 -070093 unstableThreshold: 0]);
94 }
95 }
Kailash45b2e8d2018-11-05 09:17:00 -080096 }
Kailash Khalasicdb46672018-10-30 12:55:16 -070097
Kailash45b2e8d2018-11-05 09:17:00 -080098 post {
99 always {
Kailash45b2e8d2018-11-05 09:17:00 -0800100 archiveArtifacts artifacts: '*.log'
101 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "gdepatie@northforgeinc.com, kailash@opennetworking.org", sendToIndividuals: false])
102 }
Oleg Polyakovd9de9032018-06-28 11:42:32 -0400103 }
Oleg Polyakov4d454362018-06-15 10:52:52 -0400104}
Kailash Khalasicdb46672018-10-30 12:55:16 -0700105
106