| stage 'Checkout cord repo' |
| checkout changelog: false, poll: false, scm: [$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true] |
| sh "maas login maas http://10.90.0.2/MAAS/api/2.0 ${apiKey}" |
| stage 'Release head node' |
| sh "maas maas machine release ${systemId}" |
| stage 'Acquire head Node' |
| sh 'maas maas machines allocate' |
| sh "maas maas machine deploy ${systemId}" |
| stage 'Bring up vagrant box' |
| stage 'Fetch build elements' |
| sh 'vagrant ssh -c "cd /cord/build; ./gradlew fetch" corddev' |
| sh 'vagrant ssh -c "cd /cord/build; ./gradlew buildImages" corddev' |
| stage 'Publish to headnode' |
| sh 'vagrant ssh -c "cd /cord/build; ./gradlew -PtargetReg=10.90.0.251:5000 -PdeployConfig=config/onlab_develop_pod.yml publish" corddev' |
| sh 'vagrant ssh -c "cd /cord/build; ./gradlew -PtargetReg=10.90.0.251:5000 -PdeployConfig=config/onlab_develop_pod.yml deploy" corddev' |
| currentBuild.result = 'SUCCESS' |
| currentBuild.result = 'FAILURE' |
| step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'ali@onlab.us', sendToIndividuals: false]) |
| sh 'vagrant destroy -f corddev' |
| echo "RESULT: ${currentBuild.result}" |