Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a259fd2f
Commit
a259fd2f
authored
Mar 06, 2019
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bazel maintain support for arch-less-named tarballs
parent
8495f7c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
container.bzl
build/container.bzl
+21
-11
No files found.
build/container.bzl
View file @
a259fd2f
...
@@ -17,9 +17,10 @@ load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
...
@@ -17,9 +17,10 @@ load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
load("//build:platforms.bzl", "go_platform_constraint")
load("//build:platforms.bzl", "go_platform_constraint")
# multi_arch_container produces a private internal container_image, multiple
# multi_arch_container produces a private internal container_image, multiple
# arch-specific tagged container_bundles (named NAME-ARCH) and aliases
# arch-specific tagged container_bundles (named NAME-ARCH), an alias
# from NAME and NAME.tar to the appropriately NAME-ARCH container_bundle target
# from NAME to the appropriately NAME-ARCH container_bundle target, and a
# for the currently-configured architecture.
# genrule for NAME.tar copying the appropriate NAME-ARCH container bundle
# tarball output for the currently-configured architecture.
# Additionally, if docker_push_tags is provided, uses multi_arch_container_push
# Additionally, if docker_push_tags is provided, uses multi_arch_container_push
# to create container_bundles named push-NAME-ARCH with the provided push tags,
# to create container_bundles named push-NAME-ARCH with the provided push tags,
# along with a push-NAME docker_push target.
# along with a push-NAME docker_push target.
...
@@ -70,14 +71,23 @@ def multi_arch_container(
...
@@ -70,14 +71,23 @@ def multi_arch_container(
tags = tags,
tags = tags,
visibility = visibility,
visibility = visibility,
)
)
for suffix in ["", ".tar"]:
native.alias(
native.alias(
name = name,
name = "%s%s" % (name, suffix),
actual = select({
actual = select({
go_platform_constraint(os = "linux", arch = arch): "%s-%s" % (name, arch)
go_platform_constraint(os = "linux", arch = arch): "%s-%s%s" % (name, arch, suffix)
for arch in architectures
for arch in architectures
}),
}),
)
)
native.genrule(
name = "gen_%s.tar" % name,
outs = ["%s.tar" % name],
srcs = select({
go_platform_constraint(os = "linux", arch = arch): ["%s-%s.tar" % (name, arch)]
for arch in architectures
}),
cmd = "cp $< $@",
output_to_bindir = True,
)
if docker_push_tags:
if docker_push_tags:
multi_arch_container_push(
multi_arch_container_push(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment