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 | fc95107 | 2017-05-24 15:55:34 -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 | fc95107 | 2017-05-24 15:55:34 -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 | fc95107 | 2017-05-24 15:55:34 -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 | |
| 30 | # Maven clean install |
| 31 | buildResult = main.ONOSbench.cleanInstall() |
| 32 | |
| 33 | return buildResult |