blob: 812258691c4176d4400390c3b7dd19ffc5f22ff5 [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
30 # Maven clean install
31 buildResult = main.ONOSbench.cleanInstall()
32
33 return buildResult