Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
attempt pkg_files+pkg_tar
Browse files Browse the repository at this point in the history
  • Loading branch information
Strum355 committed Apr 8, 2024
1 parent e22671b commit 2fd50a1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cmd/server/macro.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "pkg_mkdirs")

def get_last_segment(path):
segments = path.split("/")
Expand All @@ -14,11 +15,20 @@ def container_dependencies(targets):
for target in targets:
name = get_last_segment(target)

pkg_files(
name = "files_{}".format(name),
srcs = [target],
attributes = pkg_attributes(
mode = "0555",
),
prefix = "/usr/local/bin",
)

pkg_tar(
name = "tar_{}".format(name),
srcs = [target],
remap_paths = {"/{}".format(name): "/usr/local/bin/{}".format(name)},
modes = {"/usr/local/bin/{}".format(name): "0555"},
srcs = [":files_{}".format(name)],
# remap_paths = {"/{}".format(name): "/usr/local/bin/{}".format(name)},
# modes = {"/usr/local/bin/{}".format(name): "0555"},
)

def dependencies_tars(targets):
Expand Down

0 comments on commit 2fd50a1

Please sign in to comment.