blob: b7adf19793f142874e0e7a57956e4daa2d6c66cc [file] [log] [blame]
KARAF = '//lib:apache-karaf'
BRANDING = '//tools/package/branding:onos-tools-package-branding'
PATCHES = '//lib:apache-karaf-patches'
#TODO move to buck-tools
export_file (
name = 'onos-prep-karaf',
)
genrule(
name = 'onos-karaf',
srcs = glob(['bin/*', 'etc/*', 'init/*', 'runtime/bin/*']),
bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s) $(location %s)'\
% (KARAF, ONOS_VERSION, BRANDING, PATCHES),
out = 'karaf.zip',
)
staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
staged_apps = ['$(location %s)' % a for a in APPS]
# feature_coords = 'foo:bar:1.3'
sources = [ '$(location //tools/package/features:onos-features)', ]
sources += staged_repos + staged_apps
tar_file(
name = 'onos-package-runtime',
srcs = glob(['runtime/bin/*']),
root = 'tools/package',
out = 'package-runtime.tar.gz',
visibility = [ 'PUBLIC' ],
)
genrule(
name = 'onos-package',
srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
out = 'onos.tar.gz',
bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
visibility = [ 'PUBLIC' ],
)
genrule(
name = 'onos-run',
out = 'onos-run',
srcs = [ 'onos-run-karaf' ],
bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
executable = True,
visibility = [ 'PUBLIC' ],
)