blob: 501cbb33aaee44cd1d9eeb260eb7421a3b65d324 [file] [log] [blame]
Flavio Castrocc38a542016-03-03 13:15:46 -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
Devin Lim8d7c7782017-06-07 16:21:20 -070031 # buck build
32 buildResult = main.ONOSbench.buckBuild()
Flavio Castrocc38a542016-03-03 13:15:46 -080033
34 return buildResult
35
36
37
38