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