blob: 9324c2c866cae48a84936c2d774fda23488cafaa [file] [log] [blame]
Brian O'Connor9e1352f2016-04-29 17:13:33 -07001KARAF = '//lib:apache-karaf'
2BRANDING = '//tools/package/branding:onos-tools-package-branding'
Thomas Vachuska9e6432c2018-04-20 22:26:19 -07003PATCHES = '//lib:apache-karaf-patches'
Brian O'Connor9e1352f2016-04-29 17:13:33 -07004
5FEATURES = [
6 '//features:onos-thirdparty-base',
7 '//features:onos-thirdparty-web',
8 '//features:onos-api',
9 '//features:onos-core',
10 '//features:onos-incubator',
11 '//features:onos-rest',
12 '//features:onos-gui',
Sean Condon83fc39f2018-04-19 18:56:13 +010013 '//features:onos-gui2',
Brian O'Connor9e1352f2016-04-29 17:13:33 -070014 '//features:onos-cli',
Heedo Kang611a0652017-09-05 12:26:30 +090015 '//features:onos-security',
Brian O'Connor9e1352f2016-04-29 17:13:33 -070016]
17
Brian O'Connor9e1352f2016-04-29 17:13:33 -070018#TODO move to buck-tools
19export_file (
20 name = 'onos-prep-karaf',
21)
22
23genrule(
24 name = 'onos-karaf',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070025 srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']),
Thomas Vachuska9e6432c2018-04-20 22:26:19 -070026 bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\
27 % (KARAF, ONOS_VERSION, BRANDING, PATCHES),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070028 out = 'karaf.zip',
29)
30
31compile_features(
32 name = 'onos-features',
33 features = FEATURES,
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070034 maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION,
Brian O'Connor9e1352f2016-04-29 17:13:33 -070035)
36
37staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
38staged_apps = ['$(location %s)' % a for a in APPS]
39
40# feature_coords = 'foo:bar:1.3'
41sources = [ '$(location :onos-features)', ]
42sources += staged_repos + staged_apps
43
Brian O'Connor30322dd2017-08-14 19:11:29 -070044tar_file(
45 name = 'onos-package-runtime',
46 srcs = glob(['runtime/bin/*']),
47 root = 'tools/package',
48 out = 'package-runtime.tar.gz',
49 visibility = [ 'PUBLIC' ],
50)
51
Brian O'Connor9e1352f2016-04-29 17:13:33 -070052genrule(
53 name = 'onos-package',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070054 srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
Brian O'Connor92ec2132016-05-03 17:30:25 -070055 out = 'onos.tar.gz',
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070056 bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070057 visibility = [ 'PUBLIC' ],
Ray Milkey43702bf2016-05-04 10:40:55 -070058)
Thomas Vachuska5f54c6f2016-05-04 19:19:51 -070059
60genrule(
61 name = 'onos-run',
62 out = 'onos-run',
63 srcs = [ 'onos-run-karaf' ],
64 bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
65 executable = True,
66 visibility = [ 'PUBLIC' ],
Ray Milkey4abe8442016-05-05 11:21:33 -070067)