Skip to content

Commit 072d3f3

Browse files
authored
chore: add rules_shell dependency and update examples.bzl for shared file handling (#918)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 48a26d4 commit 072d3f3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

bazel/versions.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
21
VERSIONS = {
32
"go": "1.23.1",
43
"python": "3.12",
5-
64
"io_bazel_rules_go": {
75
"type": "github_archive",
86
"repo": "bazelbuild/rules_go",
97
"version": "0.53.0",
108
"sha256": "b78f77458e77162f45b4564d6b20b6f92f56431ed59eaaab09e7819d1d850313",
119
"url": "https://github.com/bazelbuild/rules_go/releases/download/v{version}/rules_go-v{version}.zip",
1210
},
13-
1411
"rules_pkg": {
1512
"type": "github_archive",
1613
"repo": "bazelbuild/rules_pkg",
1714
"version": "1.1.0",
1815
"sha256": "b7215c636f22c1849f1c3142c72f4b954bb12bb8dcf3cbe229ae6e69cc6479db",
1916
"url": "https://github.com/bazelbuild/rules_pkg/releases/download/{version}/rules_pkg-{version}.tar.gz",
2017
},
21-
2218
"rules_python": {
2319
"type": "github_archive",
2420
"repo": "bazelbuild/rules_python",
@@ -27,5 +23,12 @@ VERSIONS = {
2723
"url": "https://github.com/{repo}/releases/download/{version}/{name}-{version}.tar.gz",
2824
"strip_prefix": "{name}-{version}",
2925
},
30-
26+
"rules_shell": {
27+
"type": "github_archive",
28+
"repo": "bazelbuild/rules_shell",
29+
"version": "0.6.1",
30+
"sha256": "e6b87c89bd0b27039e3af2c5da01147452f240f75d505f5b6880874f31036307",
31+
"url": "https://github.com/{repo}/releases/download/v{version}/{name}-v{version}.tar.gz",
32+
"strip_prefix": "{name}-{version}",
33+
},
3134
}

examples.bzl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
22

33
def envoy_example(name, shared = ":shared_files", common_fun = ":verify-common.sh"):
4-
54
native.filegroup(
65
name = "%s_files" % name,
76
srcs = native.glob(["%s/**/*" % name]),
@@ -32,7 +31,7 @@ def envoy_example(name, shared = ":shared_files", common_fun = ":verify-common.s
3231
],
3332
)
3433

35-
native.sh_binary(
34+
sh_binary(
3635
name = "verify_%s" % name,
3736
srcs = [":verify_example.sh"],
3837
args = [
@@ -50,7 +49,7 @@ def envoy_examples(examples):
5049
name = "shared_files",
5150
srcs = native.glob(
5251
["shared/**/*"],
53-
exclude=[
52+
exclude = [
5453
"**/*~",
5554
"**/.*",
5655
"**/#*",
@@ -75,7 +74,7 @@ def envoy_examples(examples):
7574
RESULTS.append("%s_result" % example)
7675
RESULT_FILES.append("$(location %s)" % ("%s_result" % example))
7776

78-
native.sh_binary(
77+
sh_binary(
7978
name = "verify_examples",
8079
srcs = [":verify_examples.sh"],
8180
args = RESULT_FILES,

0 commit comments

Comments
 (0)