Skip to content

Commit 74de08a

Browse files
PiotrSikoramattklein123
authored andcommitted
build: cleanup ci/.bazelrc. (istio#4978)
Using cp results in: cp: '/source/.bazelrc' and '/build/envoy-filter-example/.bazelrc' are the same file *Risk Level*: Low *Testing*: ./ci/run_envoy_docker.sh './ci/do_circle_ci.sh bazel.dev' *Docs Changes*: n/a *Release Notes*: n/a Broken in istio#4666. Signed-off-by: Piotr Sikora <[email protected]>
1 parent ce5621f commit 74de08a

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

ci/build_setup.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ mkdir -p "${ENVOY_COVERAGE_DIR}"
108108
# This is where we build for bazel.release* and bazel.dev.
109109
export ENVOY_CI_DIR="${ENVOY_SRCDIR}"/ci
110110

111+
function cleanup() {
112+
# Remove build artifacts. This doesn't mess with incremental builds as these
113+
# are just symlinks.
114+
rm -rf "${ENVOY_SRCDIR}"/bazel-*
115+
rm -rf "${ENVOY_CI_DIR}"/bazel-*
116+
rm -rf "${ENVOY_CI_DIR}"/bazel
117+
rm -rf "${ENVOY_CI_DIR}"/tools
118+
rm -f "${ENVOY_CI_DIR}"/.bazelrc
119+
}
120+
121+
cleanup
122+
trap cleanup EXIT
123+
111124
# Hack due to https://github.com/envoyproxy/envoy/issues/838 and the need to have
112125
# .bazelrc available for build linkstamping.
113126
mkdir -p "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/bazel
@@ -123,13 +136,3 @@ ln -sf "${ENVOY_SRCDIR}"/tools/bazel.rc "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/tools/
123136
ln -sf "${ENVOY_SRCDIR}"/tools/bazel.rc "${ENVOY_CI_DIR}"/tools/
124137

125138
export BUILDIFIER_BIN="/usr/local/bin/buildifier"
126-
127-
function cleanup() {
128-
# Remove build artifacts. This doesn't mess with incremental builds as these
129-
# are just symlinks.
130-
rm -rf "${ENVOY_SRCDIR}"/bazel-*
131-
rm -rf "${ENVOY_CI_DIR}"/bazel-*
132-
rm -rf "${ENVOY_CI_DIR}"/bazel
133-
rm -rf "${ENVOY_CI_DIR}"/tools
134-
}
135-
trap cleanup EXIT

0 commit comments

Comments
 (0)