blob: 2ec1ae4bd1e380b381b93cf67aa67aef8472dd5f [file] [log] [blame]
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08001"""
2 This wrapper function is use for starting up onos instance
3"""
4
5import time
6import os
7import json
8
9def onosBuild( main, gitBranch ):
10 """
11 This includes pulling ONOS and building it using maven install
12 """
13
14 buildResult = main.FALSE
15
16 # Git checkout a branch of ONOS
17 checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
18 # Does the git pull on the branch that was checked out
19 if not checkOutResult:
20 main.log.warn( "Failed to checked out " + gitBranch +
21 " branch")
22 else:
23 main.log.info( "Successfully checked out " + gitBranch +
24 " branch")
25 gitPullResult = main.ONOSbench.gitPull()
26 if gitPullResult == main.ERROR:
27 main.log.error( "Error pulling git branch" )
28 else:
29 main.log.info( "Successfully pulled " + gitBranch + " branch" )
30
31 # Maven clean install
32 buildResult = main.ONOSbench.cleanInstall()
33
34 return buildResult