blob: f6ac4b8f40c4d20f464598a11bb4a8773d26d9cf [file] [log] [blame]
alshabib152823c2016-09-07 23:49:12 -07001
2node ('build') {
3 // Mark the code checkout 'stage'....
alshabib96a92482016-09-07 23:55:13 -07004 //stage 'Checkout'
alshabib152823c2016-09-07 23:49:12 -07005 // Get cord from opencord repo
alshabib96a92482016-09-07 23:55:13 -07006 //checkout([$class: 'RepoScm', currentBranch: true, manifestBranch: 'master', manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
alshabib152823c2016-09-07 23:49:12 -07007
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}