blob: b4acd75d21b403a88cdd72fe5e32c53f72628fe9 [file] [log] [blame]
alshabibf6c93b92016-10-22 17:55:04 +02001node('build') {
David K. Bainbridgea2a46ae2017-10-24 14:05:33 -07002 stage 'Cleanup workspace'
3 sh 'rm -rf ./build ./component ./incubator ./onos-apps ./orchestration ./test ./.repo'
4
alshabib16bdc1a2016-10-18 14:31:32 +01005 stage 'Checkout cord repo'
alshabibf6c93b92016-10-22 17:55:04 +02006 checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
alshabib16bdc1a2016-10-18 14:31:32 +01007
8 dir ('incubator/voltha') {
9 try {
10 stage 'Bring up voltha dev vm'
11 sh 'vagrant up voltha'
12
khenaidoo3a7a4e52017-07-14 15:31:46 -040013 stage 'Remove the pre-created venv-linux'
14 sh 'vagrant ssh -c "rm -rf /cord/incubator/voltha/venv-linux"'
15
khenaidoocbff06b2017-08-22 16:26:32 -040016 stage 'Use the jenkins voltha.yml file'
17 sh 'vagrant ssh -c "cp /cord/incubator/voltha/voltha/voltha.jenkins.yml /cord/incubator/voltha/voltha/voltha.yml"'
18
alshabib16bdc1a2016-10-18 14:31:32 +010019 stage 'Build voltha'
David K. Bainbridgeda617722018-01-29 09:54:40 -080020 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch && make build" voltha'
alshabib16bdc1a2016-10-18 14:31:32 +010021
alshabib428c9422016-10-24 17:30:55 -070022 stage 'Run Integration Tests'
khenaidoo1243ee92017-07-17 15:54:06 -040023 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make jenkins-test" voltha'
alshabib428c9422016-10-24 17:30:55 -070024
alshabib16bdc1a2016-10-18 14:31:32 +010025 currentBuild.result = 'SUCCESS'
alshabib428c9422016-10-24 17:30:55 -070026 slackSend channel: '#voltha', color: 'good', message: "${env.JOB_NAME} (${env.BUILD_NUMBER}) Build success.\n${env.BUILD_URL}"
alshabib16bdc1a2016-10-18 14:31:32 +010027 } catch (err) {
28 currentBuild.result = 'FAILURE'
alshabib4ba19892016-10-22 18:11:22 +020029 slackSend channel: '#voltha', color: 'danger', message: ":dizzy_face: Build failed ${env.JOB_NAME} (${env.BUILD_NUMBER})\n${env.BUILD_URL}"
alshabib16bdc1a2016-10-18 14:31:32 +010030 } finally {
31 sh 'vagrant destroy -f voltha'
32 }
33 echo "RESULT: ${currentBuild.result}"
34 }
35}