blob: a9becf94de85208fe63e138fd0b93cb4bbc08223 [file] [log] [blame]
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08001"""
2 This wrapper function is use for starting up onos instance
3"""
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08004import time
5import os
6import json
7
Jon Hall314b74a2017-05-24 16:25:52 -07008
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08009def onosBuild( main, gitBranch ):
10 """
11 This includes pulling ONOS and building it using maven install
12 """
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080013 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 Hall314b74a2017-05-24 16:25:52 -070020 " branch" )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080021 else:
22 main.log.info( "Successfully checked out " + gitBranch +
Jon Hall314b74a2017-05-24 16:25:52 -070023 " branch" )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080024 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 Lim8d7c7782017-06-07 16:21:20 -070030 # buck build
31 buildResult = main.ONOSbench.buckBuild()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080032
33 return buildResult