blob: ff7b0c34c029ef66314c6594d75dcf5e40510a8a [file] [log] [blame]
alshabibf6c93b92016-10-22 17:55:04 +02001node('build') {
alshabib16bdc1a2016-10-18 14:31:32 +01002 stage 'Checkout cord repo'
alshabibf6c93b92016-10-22 17:55:04 +02003 checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
alshabib16bdc1a2016-10-18 14:31:32 +01004
5 dir ('incubator/voltha') {
6 try {
7 stage 'Bring up voltha dev vm'
8 sh 'vagrant up voltha'
9
10 stage 'Build voltha'
alshabibeef9b132017-02-02 17:46:51 -080011 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch && make" voltha'
alshabib16bdc1a2016-10-18 14:31:32 +010012
13 stage 'Bring up voltha containers'
alshabibeef9b132017-02-02 17:46:51 -080014 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && docker-compose -f compose/docker-compose-system-test.yml up -d" voltha'
alshabib16bdc1a2016-10-18 14:31:32 +010015
alshabib428c9422016-10-24 17:30:55 -070016 stage 'Run Integration Tests'
alshabibeef9b132017-02-02 17:46:51 -080017 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make smoke-test" voltha'
alshabib428c9422016-10-24 17:30:55 -070018
alshabib16bdc1a2016-10-18 14:31:32 +010019 currentBuild.result = 'SUCCESS'
alshabib428c9422016-10-24 17:30:55 -070020 slackSend channel: '#voltha', color: 'good', message: "${env.JOB_NAME} (${env.BUILD_NUMBER}) Build success.\n${env.BUILD_URL}"
alshabib16bdc1a2016-10-18 14:31:32 +010021 } catch (err) {
22 currentBuild.result = 'FAILURE'
alshabib4ba19892016-10-22 18:11:22 +020023 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 +010024 } finally {
25 sh 'vagrant destroy -f voltha'
26 }
27 echo "RESULT: ${currentBuild.result}"
28 }
29}