blob: cfaf58990ff09ad3661bca1ebbc6078b63d03494 [file] [log] [blame]
Jon Hall66e001c2015-11-12 09:45:10 -08001"""
2 This wrapper function is use for starting up onos instance
3"""
4
5import time
6
7def 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