alshabib | f6c93b9 | 2016-10-22 17:55:04 +0200 | [diff] [blame] | 1 | node('build') { |
David K. Bainbridge | a2a46ae | 2017-10-24 14:05:33 -0700 | [diff] [blame] | 2 | stage 'Cleanup workspace' |
| 3 | sh 'rm -rf ./build ./component ./incubator ./onos-apps ./orchestration ./test ./.repo' |
| 4 | |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 5 | stage 'Checkout cord repo' |
alshabib | f6c93b9 | 2016-10-22 17:55:04 +0200 | [diff] [blame] | 6 | checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]) |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 7 | |
| 8 | dir ('incubator/voltha') { |
| 9 | try { |
| 10 | stage 'Bring up voltha dev vm' |
| 11 | sh 'vagrant up voltha' |
| 12 | |
khenaidoo | 3a7a4e5 | 2017-07-14 15:31:46 -0400 | [diff] [blame] | 13 | stage 'Remove the pre-created venv-linux' |
| 14 | sh 'vagrant ssh -c "rm -rf /cord/incubator/voltha/venv-linux"' |
| 15 | |
khenaidoo | cbff06b | 2017-08-22 16:26:32 -0400 | [diff] [blame] | 16 | 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 | |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 19 | stage 'Build voltha' |
khenaidoo | fe874ae | 2017-07-14 18:07:27 -0400 | [diff] [blame] | 20 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch-jenkins && make jenkins" voltha' |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 21 | |
| 22 | stage 'Bring up voltha containers' |
khenaidoo | fe874ae | 2017-07-14 18:07:27 -0400 | [diff] [blame] | 23 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && docker-compose -f compose/docker-compose-docutests.yml up -d" voltha' |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 24 | |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 25 | stage 'Run Integration Tests' |
khenaidoo | 1243ee9 | 2017-07-17 15:54:06 -0400 | [diff] [blame] | 26 | sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make jenkins-test" voltha' |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 27 | |
alshabib | 16bdc1a | 2016-10-18 14:31:32 +0100 | [diff] [blame] | 28 | currentBuild.result = 'SUCCESS' |
alshabib | 428c942 | 2016-10-24 17:30:55 -0700 | [diff] [blame] | 29 | 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] | 30 | } catch (err) { |
| 31 | currentBuild.result = 'FAILURE' |
alshabib | 4ba1989 | 2016-10-22 18:11:22 +0200 | [diff] [blame] | 32 | 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] | 33 | } finally { |
| 34 | sh 'vagrant destroy -f voltha' |
| 35 | } |
| 36 | echo "RESULT: ${currentBuild.result}" |
| 37 | } |
| 38 | } |