blob: a9becf94de85208fe63e138fd0b93cb4bbc08223 [file] [log] [blame]
GlennRC5147a422015-10-06 17:26:17 -07001"""
2 This wrapper function is use for starting up onos instance
3"""
GlennRC5147a422015-10-06 17:26:17 -07004import time
5import os
6import json
7
Jon Hallfc951072017-05-24 15:55:34 -07008
GlennRC5147a422015-10-06 17:26:17 -07009def onosBuild( main, gitBranch ):
10 """
11 This includes pulling ONOS and building it using maven install
12 """
GlennRC5147a422015-10-06 17:26:17 -070013 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 Hallfc951072017-05-24 15:55:34 -070020 " branch" )
GlennRC5147a422015-10-06 17:26:17 -070021 else:
22 main.log.info( "Successfully checked out " + gitBranch +
Jon Hallfc951072017-05-24 15:55:34 -070023 " branch" )
GlennRC5147a422015-10-06 17:26:17 -070024 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()
GlennRC5147a422015-10-06 17:26:17 -070032
33 return buildResult