mirror of https://github.com/k3s-io/k3s
bazel: create genrules to produce debs and RPMs without arch-specific names
parent
5312ade3d1
commit
a92c26d843
|
@ -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(
|
||||||
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(
|
||||||
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",
|
||||||
|
|
Loading…
Reference in New Issue