Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 1 | """ |
| 2 | This wrapper function is use for starting up onos instance |
| 3 | """ |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 4 | import time |
| 5 | import os |
| 6 | import json |
| 7 | |
Jon Hall | 314b74a | 2017-05-24 16:25:52 -0700 | [diff] [blame] | 8 | |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 9 | def onosBuild( main, gitBranch ): |
| 10 | """ |
| 11 | This includes pulling ONOS and building it using maven install |
| 12 | """ |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 13 | buildResult = main.FALSE |
| 14 | |
| 15 | # Git checkout a branch of ONOS |
| 16 | checkOutResult = main.ONOSbench.gitCheckout( gitBranch ) |
| 17 | # Does the git pull on the branch that was checked out |
| 18 | if not checkOutResult: |
| 19 | main.log.warn( "Failed to checked out " + gitBranch + |
Jon Hall | 314b74a | 2017-05-24 16:25:52 -0700 | [diff] [blame] | 20 | " branch" ) |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 21 | else: |
| 22 | main.log.info( "Successfully checked out " + gitBranch + |
Jon Hall | 314b74a | 2017-05-24 16:25:52 -0700 | [diff] [blame] | 23 | " branch" ) |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 24 | gitPullResult = main.ONOSbench.gitPull() |
| 25 | if gitPullResult == main.ERROR: |
| 26 | main.log.error( "Error pulling git branch" ) |
| 27 | else: |
| 28 | main.log.info( "Successfully pulled " + gitBranch + " branch" ) |
| 29 | |
Devin Lim | 8d7c778 | 2017-06-07 16:21:20 -0700 | [diff] [blame] | 30 | # buck build |
| 31 | buildResult = main.ONOSbench.buckBuild() |
Subhash Kumar Singh | c73b3a7 | 2015-11-03 21:34:04 -0800 | [diff] [blame] | 32 | |
| 33 | return buildResult |