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 | |
| 5 | FEATURES = [ |
| 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 Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 13 | '//features:onos-gui2', |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 14 | '//features:onos-cli', |
Heedo Kang | 611a065 | 2017-09-05 12:26:30 +0900 | [diff] [blame] | 15 | '//features:onos-security', |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 16 | ] |
| 17 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 18 | #TODO move to buck-tools |
| 19 | export_file ( |
| 20 | name = 'onos-prep-karaf', |
| 21 | ) |
| 22 | |
| 23 | genrule( |
| 24 | name = 'onos-karaf', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 25 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']), |
Thomas Vachuska | 9e6432c | 2018-04-20 22:26:19 -0700 | [diff] [blame] | 26 | bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\ |
| 27 | % (KARAF, ONOS_VERSION, BRANDING, PATCHES), |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 28 | out = 'karaf.zip', |
| 29 | ) |
| 30 | |
| 31 | compile_features( |
| 32 | name = 'onos-features', |
| 33 | features = FEATURES, |
Brian O'Connor | 8cc10ec | 2016-09-13 16:29:36 -0700 | [diff] [blame] | 34 | maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION, |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 35 | ) |
| 36 | |
| 37 | staged_repos = ['$(location %s-repo)' % f for f in FEATURES] |
| 38 | staged_apps = ['$(location %s)' % a for a in APPS] |
| 39 | |
| 40 | # feature_coords = 'foo:bar:1.3' |
| 41 | sources = [ '$(location :onos-features)', ] |
| 42 | sources += staged_repos + staged_apps |
| 43 | |
Brian O'Connor | 30322dd | 2017-08-14 19:11:29 -0700 | [diff] [blame] | 44 | tar_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'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 52 | genrule( |
| 53 | name = 'onos-package', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 54 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']), |
Brian O'Connor | 92ec213 | 2016-05-03 17:30:25 -0700 | [diff] [blame] | 55 | out = 'onos.tar.gz', |
Brian O'Connor | 8cc10ec | 2016-09-13 16:29:36 -0700 | [diff] [blame] | 56 | 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] | 57 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 43702bf | 2016-05-04 10:40:55 -0700 | [diff] [blame] | 58 | ) |
Thomas Vachuska | 5f54c6f | 2016-05-04 19:19:51 -0700 | [diff] [blame] | 59 | |
| 60 | genrule( |
| 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 Milkey | 4abe844 | 2016-05-05 11:21:33 -0700 | [diff] [blame] | 67 | ) |