GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 1 | """ |
| 2 | This wrapper function is use for starting up onos instance |
| 3 | """ |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 4 | import time |
| 5 | import os |
| 6 | import json |
| 7 | |
Jon Hall | 02758ac | 2017-05-24 16:20:28 -0700 | [diff] [blame] | 8 | |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 9 | def onosBuild( main, gitBranch ): |
| 10 | """ |
| 11 | This includes pulling ONOS and building it using maven install |
| 12 | """ |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [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 | 02758ac | 2017-05-24 16:20:28 -0700 | [diff] [blame] | 20 | " branch" ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 21 | else: |
| 22 | main.log.info( "Successfully checked out " + gitBranch + |
Jon Hall | 02758ac | 2017-05-24 16:20:28 -0700 | [diff] [blame] | 23 | " branch" ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [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() |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 32 | |
| 33 | return buildResult |