temp repro
This commit is contained in:
parent
747807f1ea
commit
dea04a72d8
14
BUILD
14
BUILD
@ -1,6 +1,6 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
||||
load("//src/undocker:rules.bzl", "rootfs")
|
||||
load("//src/undocker:rules.bzl", "rootfs", "temp")
|
||||
load(
|
||||
"@io_bazel_rules_docker//container:container.bzl",
|
||||
"container_bundle",
|
||||
@ -34,3 +34,15 @@ rootfs(
|
||||
#src = "@alpine//image:image",
|
||||
src = ":alpine-container-plus",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "maingo",
|
||||
srcs = ["main.go"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
temp(
|
||||
name = "temp",
|
||||
data = ":maingo",
|
||||
out = "maingo.txt",
|
||||
)
|
||||
|
16
rules.bzl
16
rules.bzl
@ -33,3 +33,19 @@ rootfs = rule(
|
||||
),
|
||||
},
|
||||
)
|
||||
|
||||
def _temp_impl(ctx):
|
||||
for f in ctx.files.data:
|
||||
print(f.path)
|
||||
ctx.actions.run_shell(
|
||||
outputs = [ctx.outputs.out],
|
||||
command = "find $@",
|
||||
)
|
||||
|
||||
temp = rule(
|
||||
implementation = _temp_impl,
|
||||
attrs = {
|
||||
"data": attr.label(mandatory = True, allow_single_file = True),
|
||||
"out": attr.output(mandatory = True)
|
||||
},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user