blob: 4e8ab7e0eb68731b8071fd1c350e54d42adcec3c [file] [log] [blame]
Brian O'Connor9e1352f2016-04-29 17:13:33 -07001KARAF = '//lib:apache-karaf'
2BRANDING = '//tools/package/branding:onos-tools-package-branding'
3
4FEATURES = [
5 '//features:onos-thirdparty-base',
6 '//features:onos-thirdparty-web',
7 '//features:onos-api',
8 '//features:onos-core',
9 '//features:onos-incubator',
10 '//features:onos-rest',
11 '//features:onos-gui',
12 '//features:onos-cli',
13#'//features:onos-security',
14]
15
Brian O'Connor9e1352f2016-04-29 17:13:33 -070016#TODO move to buck-tools
17export_file (
18 name = 'onos-prep-karaf',
19)
20
21genrule(
22 name = 'onos-karaf',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070023 srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070024 bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s)'\
25 % (KARAF, ONOS_VERSION, BRANDING),
26 out = 'karaf.zip',
27)
28
29compile_features(
30 name = 'onos-features',
31 features = FEATURES,
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070032 maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION,
Brian O'Connor9e1352f2016-04-29 17:13:33 -070033)
34
35staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
36staged_apps = ['$(location %s)' % a for a in APPS]
37
38# feature_coords = 'foo:bar:1.3'
39sources = [ '$(location :onos-features)', ]
40sources += staged_repos + staged_apps
41
42genrule(
43 name = 'onos-package',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070044 srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
Brian O'Connor92ec2132016-05-03 17:30:25 -070045 out = 'onos.tar.gz',
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070046 bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070047 visibility = [ 'PUBLIC' ],
Ray Milkey43702bf2016-05-04 10:40:55 -070048)
Thomas Vachuska5f54c6f2016-05-04 19:19:51 -070049
50genrule(
51 name = 'onos-run',
52 out = 'onos-run',
53 srcs = [ 'onos-run-karaf' ],
54 bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
55 executable = True,
56 visibility = [ 'PUBLIC' ],
Ray Milkey4abe8442016-05-05 11:21:33 -070057)