alshabib | 152823c | 2016-09-07 23:49:12 -0700 | [diff] [blame] | 1 | |
| 2 | node ('build') { |
| 3 | // Mark the code checkout 'stage'.... |
alshabib | 96a9248 | 2016-09-07 23:55:13 -0700 | [diff] [blame^] | 4 | //stage 'Checkout' |
alshabib | 152823c | 2016-09-07 23:49:12 -0700 | [diff] [blame] | 5 | // Get cord from opencord repo |
alshabib | 96a9248 | 2016-09-07 23:55:13 -0700 | [diff] [blame^] | 6 | //checkout([$class: 'RepoScm', currentBranch: true, manifestBranch: 'master', manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]) |
alshabib | 152823c | 2016-09-07 23:49:12 -0700 | [diff] [blame] | 7 | |
| 8 | stage 'chdir to build' |
| 9 | dir('build') { |
| 10 | try { |
| 11 | stage 'Bring up vagrant box' |
| 12 | sh 'vagrant up corddev' |
| 13 | |
| 14 | stage 'Fetch build elements' |
| 15 | sh 'vagrant ssh -c "cd /cord/build; ./gradlew fetch" corddev' |
| 16 | |
| 17 | stage 'Build Images' |
| 18 | sh 'vagrant ssh -c "cd /cord/build; ./gradlew buildImages" corddev' |
| 19 | |
| 20 | stage 'Publish to headnode' |
| 21 | sh 'vagrant ssh -c "cd /cord/build; ./gradlew -PtargetReg=10.90.0.251:5000 -PdeployConfig=config/onlab_develop_pod.yml publish" corddev' |
| 22 | |
| 23 | stage 'Deploy' |
| 24 | sh 'vagrant ssh -c "cd /cord/build; ./gradlew -PtargetReg=10.90.0.251:5000 -PdeployConfig=config/onlab_develop_pod.yml deploy" corddev' |
| 25 | |
| 26 | currentBuild.result = 'SUCCESS' |
| 27 | } catch (err) { |
| 28 | currentBuild.result = 'FAILURE' |
| 29 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'ali@onlab.us', sendToIndividuals: false]) |
| 30 | } finally { |
| 31 | sh 'vagrant destroy -f corddev' |
| 32 | } |
| 33 | echo "RESULT: ${currentBuild.result}" |
| 34 | } |
| 35 | |
| 36 | } |