From 162d4c84ea3f8dc2b5461947ed3f20e30d25ff93 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 7 Nov 2018 09:58:24 -0800 Subject: [PATCH] build: cleanup ci/.bazelrc. (#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 #4666. Signed-off-by: Piotr Sikora Signed-off-by: Fred Douglas --- ci/build_setup.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ci/build_setup.sh b/ci/build_setup.sh index f13905ca9139..271d12176efd 100755 --- a/ci/build_setup.sh +++ b/ci/build_setup.sh @@ -108,6 +108,19 @@ mkdir -p "${ENVOY_COVERAGE_DIR}" # This is where we build for bazel.release* and bazel.dev. export ENVOY_CI_DIR="${ENVOY_SRCDIR}"/ci +function cleanup() { + # Remove build artifacts. This doesn't mess with incremental builds as these + # are just symlinks. + rm -rf "${ENVOY_SRCDIR}"/bazel-* + rm -rf "${ENVOY_CI_DIR}"/bazel-* + rm -rf "${ENVOY_CI_DIR}"/bazel + rm -rf "${ENVOY_CI_DIR}"/tools + rm -f "${ENVOY_CI_DIR}"/.bazelrc +} + +cleanup +trap cleanup EXIT + # Hack due to https://github.com/envoyproxy/envoy/issues/838 and the need to have # .bazelrc available for build linkstamping. mkdir -p "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/bazel @@ -123,13 +136,3 @@ ln -sf "${ENVOY_SRCDIR}"/tools/bazel.rc "${ENVOY_FILTER_EXAMPLE_SRCDIR}"/tools/ ln -sf "${ENVOY_SRCDIR}"/tools/bazel.rc "${ENVOY_CI_DIR}"/tools/ export BUILDIFIER_BIN="/usr/local/bin/buildifier" - -function cleanup() { - # Remove build artifacts. This doesn't mess with incremental builds as these - # are just symlinks. - rm -rf "${ENVOY_SRCDIR}"/bazel-* - rm -rf "${ENVOY_CI_DIR}"/bazel-* - rm -rf "${ENVOY_CI_DIR}"/bazel - rm -rf "${ENVOY_CI_DIR}"/tools -} -trap cleanup EXIT