Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 1 | KARAF = '//lib:apache-karaf' |
| 2 | BRANDING = '//tools/package/branding:onos-tools-package-branding' |
Thomas Vachuska | 9e6432c | 2018-04-20 22:26:19 -0700 | [diff] [blame] | 3 | PATCHES = '//lib:apache-karaf-patches' |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 4 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 5 | #TODO move to buck-tools |
| 6 | export_file ( |
| 7 | name = 'onos-prep-karaf', |
| 8 | ) |
| 9 | |
| 10 | genrule( |
| 11 | name = 'onos-karaf', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 12 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']), |
Thomas Vachuska | 9e6432c | 2018-04-20 22:26:19 -0700 | [diff] [blame] | 13 | bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\ |
| 14 | % (KARAF, ONOS_VERSION, BRANDING, PATCHES), |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 15 | out = 'karaf.zip', |
| 16 | ) |
| 17 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 18 | staged_repos = ['$(location %s-repo)' % f for f in FEATURES] |
| 19 | staged_apps = ['$(location %s)' % a for a in APPS] |
| 20 | |
| 21 | # feature_coords = 'foo:bar:1.3' |
Thomas Vachuska | f25c248 | 2018-06-12 13:18:45 -0700 | [diff] [blame^] | 22 | sources = [ '$(location //tools/package/features:onos-features)', ] |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 23 | sources += staged_repos + staged_apps |
| 24 | |
Brian O'Connor | 30322dd | 2017-08-14 19:11:29 -0700 | [diff] [blame] | 25 | tar_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'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 33 | genrule( |
| 34 | name = 'onos-package', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 35 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']), |
Brian O'Connor | 92ec213 | 2016-05-03 17:30:25 -0700 | [diff] [blame] | 36 | out = 'onos.tar.gz', |
Brian O'Connor | 8cc10ec | 2016-09-13 16:29:36 -0700 | [diff] [blame] | 37 | bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources), |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 38 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 43702bf | 2016-05-04 10:40:55 -0700 | [diff] [blame] | 39 | ) |
Thomas Vachuska | 5f54c6f | 2016-05-04 19:19:51 -0700 | [diff] [blame] | 40 | |
| 41 | genrule( |
| 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 Milkey | 4abe844 | 2016-05-05 11:21:33 -0700 | [diff] [blame] | 48 | ) |