kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1 | """ |
| 2 | This wrapper function is use for starting up onos instance |
| 3 | """ |
| 4 | |
| 5 | import time |
| 6 | import os |
| 7 | import json |
| 8 | |
| 9 | def onosBuild( main, gitBranch ): |
| 10 | """ |
| 11 | This includes pulling ONOS and building it using maven install |
| 12 | """ |
| 13 | |
| 14 | buildResult = main.FALSE |
| 15 | |
| 16 | # Git checkout a branch of ONOS |
| 17 | checkOutResult = main.ONOSbench.gitCheckout( gitBranch ) |
| 18 | # Does the git pull on the branch that was checked out |
| 19 | if not checkOutResult: |
| 20 | main.log.warn( "Failed to checked out " + gitBranch + |
| 21 | " branch") |
| 22 | else: |
| 23 | main.log.info( "Successfully checked out " + gitBranch + |
| 24 | " branch") |
| 25 | gitPullResult = main.ONOSbench.gitPull() |
| 26 | if gitPullResult == main.ERROR: |
| 27 | main.log.error( "Error pulling git branch" ) |
| 28 | else: |
| 29 | main.log.info( "Successfully pulled " + gitBranch + " branch" ) |
| 30 | |
| 31 | # Maven clean install |
| 32 | buildResult = main.ONOSbench.cleanInstall() |
| 33 | |
| 34 | return buildResult |
| 35 | |
| 36 | |
| 37 | |
| 38 | |