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