blob: 1a656425270a5c0f976f87974eee9cbcf6421361 [file] [log] [blame]
Thomas Vachuskaa8e1bd42018-06-11 15:45:11 -07001load("//tools/build/bazel:generate_workspace.bzl", "ONOS_VERSION")
2
3KARAF = "@apache_karaf//file"
4PATCHES = "@apache_karaf_patches//file"
5BRANDING = "//tools/package/branding:onos-tools-package-branding"
6
7# FIXME: This is still work in progress
8genrule(
9 name = "onos-karaf",
10 srcs = [
11 KARAF,
12 PATCHES,
13 BRANDING,
14 ] + glob(["bin/*", "etc/*", "init/*", "runtime/bin/*"]),
15 outs = ["karaf.zip"],
16 cmd = "echo $(location onos-prep-karaf) $(location karaf.zip) $(location %s) %s $(location %s) $(location %s) > $(location karaf.zip)" \
17 % (KARAF, ONOS_VERSION, BRANDING, PATCHES),
18 tools = ["onos-prep-karaf"],
19 visibility = ["//visibility:public"],
20)
21# cmd = "$(location onos-prep-karaf) $(location karaf.zip) $(location %s) %s $(location %s) $(location %s)" \
22# % (KARAF, ONOS_VERSION), BRANDING, PATCHES),
23
24PACKAGING_REQUIREMENTS = [
25 "//features:onos-features",
26 ":onos-karaf",
27]
28
29# FIXME: This is still work in progress
30genrule(
31 name = "onos-package",
32 srcs = PACKAGING_REQUIREMENTS + glob(["bin/*", "etc/*", "init/*", "config/*", "runtime/bin/*"]),
33 outs = ["onos.tar.gz"],
34 cmd = "echo $(location onos_stage.py) $(location onos.tar.gz) $(location :onos-karaf) $(location //features:onos-features) $(SRCS) >$(location onos.tar.gz)",
35 visibility = ["//visibility:public"],
36 tools = ["onos_stage.py"],
37)
38# cmd = "$(location onos_stage.py) $(location onos.tar.gz) $(location :onos-karaf) $(SRCS)",
39# cmd = "$(exe //buck-tools:onos-stage) $OUT " + ONOS_VERSION + " $(location :onos-karaf) " + " ".join(sources),
40
41
42#staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
43#staged_apps = ['$(location %s)' % a for a in APPS]
44#
45## feature_coords = 'foo:bar:1.3'
46#sources = [ '$(location :onos-features)', ]
47#sources += staged_repos + staged_apps
48#
49#tar_file(
50# name = 'onos-package-runtime',
51# srcs = glob(['runtime/bin/*']),
52# root = 'tools/package',
53# out = 'package-runtime.tar.gz',
54# visibility = [ 'PUBLIC' ],
55#)
56#
57#genrule(
58# name = 'onos-package',
59# srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*', 'runtime/bin/*']),
60# out = 'onos.tar.gz',
61# bash = '$(exe //buck-tools:onos-stage) $OUT ' + ONOS_VERSION + ' $(location :onos-karaf) ' + ' '.join(sources),
62# visibility = [ 'PUBLIC' ],
63#)
64#
65#genrule(
66# name = 'onos-run',
67# out = 'onos-run',
68# srcs = [ 'onos-run-karaf' ],
69# bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
70# executable = True,
71# visibility = [ 'PUBLIC' ],
72#)