alshabib | f6c93b9 | 2016-10-22 17:55:04 +0200 | [diff] [blame] | 1 | node('build') { |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 2 | stage 'Checkout cord repo' |
alshabib | f6c93b9 | 2016-10-22 17:55:04 +0200 | [diff] [blame] | 3 | checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]) |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 4 | |
| 5 | dir ('incubator/voltha') { |
| 6 | try { |
| 7 | stage 'Bring up voltha dev vm' |
| 8 | sh 'vagrant up voltha' |
| 9 | |
| 10 | stage 'Build voltha' |
khenaidoo | 4f2646f | 2017-06-09 11:42:58 -0400 | [diff] [blame^] | 11 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch && make build" voltha' |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 12 | |
| 13 | stage 'Bring up voltha containers' |
alshabib | eef9b13 | 2017-02-02 17:46:51 -0800 | [diff] [blame] | 14 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && docker-compose -f compose/docker-compose-system-test.yml up -d" voltha' |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 15 | |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 16 | stage 'Run Integration Tests' |
alshabib | eef9b13 | 2017-02-02 17:46:51 -0800 | [diff] [blame] | 17 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make smoke-test" voltha' |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 18 | |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 19 | currentBuild.result = 'SUCCESS' |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 20 | slackSend channel: '#voltha', color: 'good', message: "${env.JOB_NAME} (${env.BUILD_NUMBER}) Build success.\n${env.BUILD_URL}" |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 21 | } catch (err) { |
| 22 | currentBuild.result = 'FAILURE' |
alshabib | 4ba1989 | 2016-10-22 18:11:22 +0200 | [diff] [blame] | 23 | slackSend channel: '#voltha', color: 'danger', message: ":dizzy_face: Build failed ${env.JOB_NAME} (${env.BUILD_NUMBER})\n${env.BUILD_URL}" |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 24 | } finally { |
| 25 | sh 'vagrant destroy -f voltha' |
| 26 | } |
| 27 | echo "RESULT: ${currentBuild.result}" |
| 28 | } |
| 29 | } |