remove bazelishms

This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent 26c03ed8d1
commit f16bca5ce6
4 changed files with 0 additions and 116 deletions

27
BUILD
View File

@ -1,27 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "git.sr.ht/~motiejus/code/undocker",
visibility = ["//visibility:private"],
deps = ["//src/undocker/rootfs:go_default_library"],
)
go_binary(
name = "undocker",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = ["main_test.go"],
embed = [":go_default_library"],
deps = [
"@com_github_stretchr_testify//assert:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
],
)

View File

@ -1,19 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["tartest.go"],
importpath = "git.sr.ht/~motiejus/code/undocker/internal/tartest",
visibility = ["//visibility:public"],
deps = ["@com_github_stretchr_testify//require:go_default_library"],
)
go_test(
name = "go_default_test",
srcs = ["tartest_test.go"],
embed = [":go_default_library"],
deps = [
"@com_github_stretchr_testify//assert:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
],
)

View File

@ -1,26 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"rootfs.go",
"tree.go",
],
importpath = "git.sr.ht/~motiejus/code/undocker/rootfs",
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = [
"rootfs_test.go",
"tree_test.go",
],
embed = [":go_default_library"],
deps = [
"//src/undocker/internal/tartest:go_default_library",
"@com_github_stretchr_testify//assert:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
],
)

View File

@ -1,44 +0,0 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
_undocker_cli = attr.label(
doc = "undocker cli; private and may not be overridden",
cfg = "host",
default = Label("//src/undocker:undocker"),
allow_single_file = True,
executable = True,
)
_input_container = attr.label(
doc = "Input container tarball",
mandatory = True,
allow_single_file = [".tar"],
)
def _rootfs_impl(ctx):
out = ctx.outputs.out
if out == None:
out = ctx.actions.declare_file(ctx.attr.name + ".tar")
ctx.actions.run(
outputs = [out],
inputs = ctx.files.src,
executable = ctx.executable._undocker,
arguments = [
ctx.files.src[0].path,
out.path,
],
mnemonic = "RootFS",
)
return DefaultInfo(
files = depset([out]),
runfiles = ctx.runfiles(files = ctx.files.src),
)
rootfs = rule(
_rootfs_impl,
doc = "Generate a rootfs from a docker container image",
attrs = {
"src": _input_container,
"_undocker": _undocker_cli,
"out": attr.output(),
},
)