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' |
| 3 | |
| 4 | FEATURES = [ |
| 5 | '//features:onos-thirdparty-base', |
| 6 | '//features:onos-thirdparty-web', |
| 7 | '//features:onos-api', |
| 8 | '//features:onos-core', |
| 9 | '//features:onos-incubator', |
| 10 | '//features:onos-rest', |
| 11 | '//features:onos-gui', |
| 12 | '//features:onos-cli', |
Heedo Kang | 611a065 | 2017-09-05 12:26:30 +0900 | [diff] [blame] | 13 | '//features:onos-security', |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 14 | ] |
| 15 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 16 | #TODO move to buck-tools |
| 17 | export_file ( |
| 18 | name = 'onos-prep-karaf', |
| 19 | ) |
| 20 | |
| 21 | genrule( |
| 22 | name = 'onos-karaf', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 23 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']), |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 24 | bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s)'\ |
| 25 | % (KARAF, ONOS_VERSION, BRANDING), |
| 26 | out = 'karaf.zip', |
| 27 | ) |
| 28 | |
| 29 | compile_features( |
| 30 | name = 'onos-features', |
| 31 | features = FEATURES, |
Brian O'Connor | 8cc10ec | 2016-09-13 16:29:36 -0700 | [diff] [blame] | 32 | maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION, |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 33 | ) |
| 34 | |
| 35 | staged_repos = ['$(location %s-repo)' % f for f in FEATURES] |
| 36 | staged_apps = ['$(location %s)' % a for a in APPS] |
| 37 | |
| 38 | # feature_coords = 'foo:bar:1.3' |
| 39 | sources = [ '$(location :onos-features)', ] |
| 40 | sources += staged_repos + staged_apps |
| 41 | |
Brian O'Connor | 30322dd | 2017-08-14 19:11:29 -0700 | [diff] [blame] | 42 | tar_file( |
| 43 | name = 'onos-package-runtime', |
| 44 | srcs = glob(['runtime/bin/*']), |
| 45 | root = 'tools/package', |
| 46 | out = 'package-runtime.tar.gz', |
| 47 | visibility = [ 'PUBLIC' ], |
| 48 | ) |
| 49 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 50 | genrule( |
| 51 | name = 'onos-package', |
Ray Milkey | 5c0d8f9 | 2017-06-09 12:26:31 -0700 | [diff] [blame] | 52 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']), |
Brian O'Connor | 92ec213 | 2016-05-03 17:30:25 -0700 | [diff] [blame] | 53 | out = 'onos.tar.gz', |
Brian O'Connor | 8cc10ec | 2016-09-13 16:29:36 -0700 | [diff] [blame] | 54 | 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] | 55 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 43702bf | 2016-05-04 10:40:55 -0700 | [diff] [blame] | 56 | ) |
Thomas Vachuska | 5f54c6f | 2016-05-04 19:19:51 -0700 | [diff] [blame] | 57 | |
| 58 | genrule( |
| 59 | name = 'onos-run', |
| 60 | out = 'onos-run', |
| 61 | srcs = [ 'onos-run-karaf' ], |
| 62 | bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT', |
| 63 | executable = True, |
| 64 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 4abe844 | 2016-05-05 11:21:33 -0700 | [diff] [blame] | 65 | ) |