blob: a3179838406d69c6d1d7631a12ee117efdd97aea [file] [log] [blame]
Brian O'Connor9e1352f2016-04-29 17:13:33 -07001KARAF = '//lib:apache-karaf'
2BRANDING = '//tools/package/branding:onos-tools-package-branding'
Thomas Vachuska335e9ae2018-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',
13 '//features:onos-cli',
Heedo Kang611a0652017-09-05 12:26:30 +090014 '//features:onos-security',
Brian O'Connor9e1352f2016-04-29 17:13:33 -070015]
16
Brian O'Connor9e1352f2016-04-29 17:13:33 -070017#TODO move to buck-tools
18export_file (
19 name = 'onos-prep-karaf',
20)
21
22genrule(
23 name = 'onos-karaf',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070024 srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']),
Thomas Vachuska335e9ae2018-04-20 22:26:19 -070025 bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\
26 % (KARAF, ONOS_VERSION, BRANDING, PATCHES),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070027 out = 'karaf.zip',
28)
29
30compile_features(
31 name = 'onos-features',
32 features = FEATURES,
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070033 maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION,
Brian O'Connor9e1352f2016-04-29 17:13:33 -070034)
35
36staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
37staged_apps = ['$(location %s)' % a for a in APPS]
38
39# feature_coords = 'foo:bar:1.3'
40sources = [ '$(location :onos-features)', ]
41sources += staged_repos + staged_apps
42
Brian O'Connor30322dd2017-08-14 19:11:29 -070043tar_file(
44 name = 'onos-package-runtime',
45 srcs = glob(['runtime/bin/*']),
46 root = 'tools/package',
47 out = 'package-runtime.tar.gz',
48 visibility = [ 'PUBLIC' ],
49)
50
Brian O'Connor9e1352f2016-04-29 17:13:33 -070051genrule(
52 name = 'onos-package',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070053 srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
Brian O'Connor92ec2132016-05-03 17:30:25 -070054 out = 'onos.tar.gz',
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070055 bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070056 visibility = [ 'PUBLIC' ],
Ray Milkey43702bf2016-05-04 10:40:55 -070057)
Thomas Vachuska5f54c6f2016-05-04 19:19:51 -070058
59genrule(
60 name = 'onos-run',
61 out = 'onos-run',
62 srcs = [ 'onos-run-karaf' ],
63 bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
64 executable = True,
65 visibility = [ 'PUBLIC' ],
Ray Milkey4abe8442016-05-05 11:21:33 -070066)