blob: 25ad93394c8de49eebf183ac16b92d2895ba2b42 [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
khenaidoo3a7a4e52017-07-14 15:31:46 -040010 stage 'Remove the pre-created venv-linux'
11 sh 'vagrant ssh -c "rm -rf /cord/incubator/voltha/venv-linux"'
12
alshabib16bdc1a2016-10-18 14:31:32 +010013 stage 'Build voltha'
khenaidoo4f2646f2017-06-09 11:42:58 -040014 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch && make build" voltha'
alshabib16bdc1a2016-10-18 14:31:32 +010015
16 stage 'Bring up voltha containers'
alshabibeef9b132017-02-02 17:46:51 -080017 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 +010018
alshabib428c9422016-10-24 17:30:55 -070019 stage 'Run Integration Tests'
alshabibeef9b132017-02-02 17:46:51 -080020 sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make smoke-test" voltha'
alshabib428c9422016-10-24 17:30:55 -070021
alshabib16bdc1a2016-10-18 14:31:32 +010022 currentBuild.result = 'SUCCESS'
alshabib428c9422016-10-24 17:30:55 -070023 slackSend channel: '#voltha', color: 'good', message: "${env.JOB_NAME} (${env.BUILD_NUMBER}) Build success.\n${env.BUILD_URL}"
alshabib16bdc1a2016-10-18 14:31:32 +010024 } catch (err) {
25 currentBuild.result = 'FAILURE'
alshabib4ba19892016-10-22 18:11:22 +020026 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 +010027 } finally {
28 sh 'vagrant destroy -f voltha'
29 }
30 echo "RESULT: ${currentBuild.result}"
31 }
32}