blob: 9ebeb60c042f80a77aa064d87e818a57c0d0f287 [file] [log] [blame]
Jon Hall66e001c2015-11-12 09:45:10 -08001"""
2 This wrapper function is use for starting up onos instance
3"""
Jon Hall66e001c2015-11-12 09:45:10 -08004import time
5
Jon Hallbc080f92017-05-24 16:29:55 -07006
Jon Hall66e001c2015-11-12 09:45:10 -08007def onosBuild( main, gitBranch ):
8 """
9 This includes pulling ONOS and building it using maven install
10 """
Jon Hall66e001c2015-11-12 09:45:10 -080011 buildResult = main.FALSE
12
13 # Git checkout a branch of ONOS
14 checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
15 # Does the git pull on the branch that was checked out
16 if not checkOutResult:
17 main.log.warn( "Failed to checked out " + gitBranch +
Jon Hallbc080f92017-05-24 16:29:55 -070018 " branch" )
Jon Hall66e001c2015-11-12 09:45:10 -080019 else:
20 main.log.info( "Successfully checked out " + gitBranch +
Jon Hallbc080f92017-05-24 16:29:55 -070021 " branch" )
Jon Hall66e001c2015-11-12 09:45:10 -080022 gitPullResult = main.ONOSbench.gitPull()
23 if gitPullResult == main.ERROR:
24 main.log.error( "Error pulling git branch" )
25 else:
26 main.log.info( "Successfully pulled " + gitBranch + " branch" )
27
Devin Lim8d7c7782017-06-07 16:21:20 -070028 # buck build
29 buildResult = main.ONOSbench.buckBuild()
Jon Hall66e001c2015-11-12 09:45:10 -080030
31 return buildResult