blob: b7adf19793f142874e0e7a57956e4daa2d6c66cc [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
Brian O'Connor9e1352f2016-04-29 17:13:33 -07005#TODO move to buck-tools
6export_file (
7 name = 'onos-prep-karaf',
8)
9
10genrule(
11 name = 'onos-karaf',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070012 srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']),
Thomas Vachuska9e6432c2018-04-20 22:26:19 -070013 bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\
14 % (KARAF, ONOS_VERSION, BRANDING, PATCHES),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070015 out = 'karaf.zip',
16)
17
Brian O'Connor9e1352f2016-04-29 17:13:33 -070018staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
19staged_apps = ['$(location %s)' % a for a in APPS]
20
21# feature_coords = 'foo:bar:1.3'
Thomas Vachuskaf25c2482018-06-12 13:18:45 -070022sources = [ '$(location //tools/package/features:onos-features)', ]
Brian O'Connor9e1352f2016-04-29 17:13:33 -070023sources += staged_repos + staged_apps
24
Brian O'Connor30322dd2017-08-14 19:11:29 -070025tar_file(
26 name = 'onos-package-runtime',
27 srcs = glob(['runtime/bin/*']),
28 root = 'tools/package',
29 out = 'package-runtime.tar.gz',
30 visibility = [ 'PUBLIC' ],
31)
32
Brian O'Connor9e1352f2016-04-29 17:13:33 -070033genrule(
34 name = 'onos-package',
Ray Milkey5c0d8f92017-06-09 12:26:31 -070035 srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
Brian O'Connor92ec2132016-05-03 17:30:25 -070036 out = 'onos.tar.gz',
Brian O'Connor8cc10ec2016-09-13 16:29:36 -070037 bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
Brian O'Connor9e1352f2016-04-29 17:13:33 -070038 visibility = [ 'PUBLIC' ],
Ray Milkey43702bf2016-05-04 10:40:55 -070039)
Thomas Vachuska5f54c6f2016-05-04 19:19:51 -070040
41genrule(
42 name = 'onos-run',
43 out = 'onos-run',
44 srcs = [ 'onos-run-karaf' ],
45 bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
46 executable = True,
47 visibility = [ 'PUBLIC' ],
Ray Milkey4abe8442016-05-05 11:21:33 -070048)