Commit a92c26d8 authored by Jeff Grafton's avatar Jeff Grafton

bazel: create genrules to produce debs and RPMs without arch-specific names

parent 5312ade3
...@@ -21,32 +21,38 @@ release_filegroup( ...@@ -21,32 +21,38 @@ release_filegroup(
name = "debs", name = "debs",
conditioned_srcs = for_platforms( conditioned_srcs = for_platforms(
default = [], default = [],
for_client = [":kubectl-{ARCH}.deb"], for_client = [":kubectl.deb"],
for_node = [ for_node = [
":cri-tools-{ARCH}.deb", ":cri-tools.deb",
":kubeadm-{ARCH}.deb", ":kubeadm.deb",
":kubelet-{ARCH}.deb", ":kubelet.deb",
":kubernetes-cni-{ARCH}.deb", ":kubernetes-cni.deb",
], ],
only_os = "linux", only_os = "linux",
), ),
) )
# Create aliases from the non-arch names to the arch-specific names for backwards compatibility # Create genrules to copy the arch-specific debs to debs without the arch in their filename.
alias( genrule(
name = "kubectl", name = "kubectl",
actual = select(for_platforms( srcs = select(for_platforms(
for_client = ":kubectl-{ARCH}", for_client = [":kubectl-{ARCH}.deb"],
only_os = "linux", only_os = "linux",
)), )),
outs = ["kubectl.deb"],
cmd = "cp $< $@",
output_to_bindir = True,
) )
[alias( [genrule(
name = pkg, name = pkg,
actual = select(for_platforms( srcs = select(for_platforms(
for_node = ":%s-{ARCH}" % pkg, for_node = [":%s-{ARCH}.deb" % pkg],
only_os = "linux", only_os = "linux",
)), )),
outs = ["%s.deb" % pkg],
cmd = "cp $< $@",
output_to_bindir = True,
) for pkg in [ ) for pkg in [
"cri-tools", "cri-tools",
"kubeadm", "kubeadm",
......
...@@ -9,12 +9,12 @@ release_filegroup( ...@@ -9,12 +9,12 @@ release_filegroup(
name = "rpms", name = "rpms",
conditioned_srcs = for_platforms( conditioned_srcs = for_platforms(
default = [], default = [],
for_client = [":kubectl-{ARCH}"], for_client = [":kubectl.rpm"],
for_node = [ for_node = [
":cri-tools-{ARCH}", ":cri-tools.rpm",
":kubeadm-{ARCH}", ":kubeadm.rpm",
":kubelet-{ARCH}", ":kubelet.rpm",
":kubernetes-cni-{ARCH}", ":kubernetes-cni.rpm",
], ],
only_os = "linux", only_os = "linux",
), ),
...@@ -22,21 +22,27 @@ release_filegroup( ...@@ -22,21 +22,27 @@ release_filegroup(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
# Create aliases from the non-arch names to the arch-specific names for backwards compatibility # Create genrules to copy the arch-specific RPMs to RPMs without the arch in their filename.
alias( genrule(
name = "kubectl", name = "kubectl",
actual = select(for_platforms( srcs = select(for_platforms(
for_client = ":kubectl-{ARCH}", for_client = [":kubectl-{ARCH}.rpm"],
only_os = "linux", only_os = "linux",
)), )),
outs = ["kubectl.rpm"],
cmd = "cp $< $@",
output_to_bindir = True,
) )
[alias( [genrule(
name = pkg, name = pkg,
actual = select(for_platforms( srcs = select(for_platforms(
for_client = ":%s-{ARCH}" % pkg, for_client = [":%s-{ARCH}.rpm" % pkg],
only_os = "linux", only_os = "linux",
)), )),
outs = ["%s.rpm" % pkg],
cmd = "cp $< $@",
output_to_bindir = True,
) for pkg in [ ) for pkg in [
"cri-tools", "cri-tools",
"kubeadm", "kubeadm",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment