Skip to content

Commit 54b89e6

Browse files
committed
verify: Fix for calling verify_examples externally
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent 14e1ad4 commit 54b89e6

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

.github/workflows/docs.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ jobs:
5353
common --config=rbe
5454
common --config=bes
5555
EOF
56-
57-
# temp hacks to make envoy use new names
58-
sed -i -f /dev/stdin bazel/repositories.bzl <<'SED'
59-
/^[[:space:]]*external_http_archive[[:space:]]*(/,/^[[:space:]]*)[[:space:]]*$/{
60-
s/^[[:space:]]*name[[:space:]]*=[[:space:]]*"envoy_examples",[[:space:]]*$/ name = "envoy-examples",\
61-
location_name = "envoy_examples",/
62-
}
63-
SED
64-
65-
git grep -l '@envoy_example' | xargs sed -i 's/@envoy_example/@envoy-example/g'
6656
working-directory: envoy
6757
6858
- run: |

examples.bzl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ def envoy_example(name, shared = ":shared_files", common_fun = ":verify-common.s
1616
name = "%s_dir" % name,
1717
outs = ["%s_dir.tar" % name],
1818
cmd = """
19-
SHARED_PATHS="$(locations %s)"
20-
SHARED=$$(echo $$SHARED_PATHS | cut -d/ -f1)
19+
read -ra SHARED_PATHS <<< "$(locations %s)"
20+
SHARED_DIR=$$(echo $${SHARED_PATHS[0]} | cut -d/ -f1)
2121
# This is a bit hacky and may not work in all bazel situations, but works for now
22-
if [[ $$SHARED == "external" ]]; then
23-
SHARED=$$(echo $$SHARED_PATHS | cut -d/ -f-3)
22+
if [[ $$SHARED_DIR == "external" ]]; then
23+
SHARED_DIR=$$(echo $${SHARED_PATHS[0]} | cut -d/ -f-3)
2424
fi
25-
EXAMPLE_PATHS="$(locations %s_files)"
26-
EXAMPLE=$$(echo $$EXAMPLE_PATHS | cut -d/ -f1)
25+
EXAMPLE=%s
26+
read -ra EXAMPLE_PATHS <<< "$(locations %s_files)"
27+
EXAMPLE_DIR=$$(echo $${EXAMPLE_PATHS[0]} | cut -d/ -f1)
2728
# This is a bit hacky and may not work in all bazel situations, but works for now
28-
if [[ $$EXAMPLE == "external" ]]; then
29-
EXAMPLE=$$(echo $$EXAMPLE_PATHS | cut -d/ -f-3)
29+
if [[ $$EXAMPLE_DIR == "external" ]]; then
30+
EXAMPLE_DIR=$$(echo $$EXAMPLE_PATHS | cut -d/ -f-3)
3031
fi
31-
tar chf $@ -C . $$SHARED $(location %s) $$EXAMPLE
32-
""" % (shared, name, common_fun),
32+
TARGET_DIR=$$(dirname $$EXAMPLE_DIR)
33+
tar chf $@ -C $$TARGET_DIR --exclude="$$(basename "$@")" .
34+
""" % (shared, name, name),
3335
tools = [
3436
common_fun,
3537
shared,

0 commit comments

Comments
 (0)