blob: bf2a2b68e45109263ba1ca144925067ac42997f6 [file] [log] [blame]
acsmars51a7fe02015-10-29 18:33:32 -07001"""
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
35
36
37
38