YPZhang | cb86c5b | 2016-01-27 17:38:12 -0800 | [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 | |
Devin Lim | 8d7c778 | 2017-06-07 16:21:20 -0700 | [diff] [blame] | 31 | # buck build |
| 32 | buildResult = main.ONOSbench.buckBuild() |
YPZhang | cb86c5b | 2016-01-27 17:38:12 -0800 | [diff] [blame] | 33 | |
| 34 | return buildResult |
| 35 | |
| 36 | |
| 37 | |
| 38 | |