From e62ee67dfbd8761e26835bddf10b66bb9a88256f Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Sun, 7 May 2017 11:11:13 -0400 Subject: [PATCH] ci: add bazel.debug[.server_only] targets. Fixes #908. --- ci/README.md | 13 ++++++++++++- ci/do_ci.sh | 23 ++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ci/README.md b/ci/README.md index a5f1eceb2c2dd..8250450c73a86 100644 --- a/ci/README.md +++ b/ci/README.md @@ -41,12 +41,23 @@ For a release version of the Envoy binary you can run: ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.release.server_only' ``` -The artifacts can be found in `/tmp/envoy-docker-build/envoy/source/exe/envoy` (or wherever +The build artifact can be found in `/tmp/envoy-docker-build/envoy/source/exe/envoy` (or wherever +`$ENVOY_DOCKER_BUILD_DIR` points). + +For a debug version of the Envoy binary you can run: + +```bash +./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.debug.server_only' +``` + +The build artifact can be found in `/tmp/envoy-docker-build/envoy/source/exe/envoy-debug` (or wherever `$ENVOY_DOCKER_BUILD_DIR` points). The `./ci/run_envoy_docker.sh './ci/do_ci.sh '` targets are: * `bazel.asan` — build and run tests under `-c dbg --config=asan`. +* `bazel.debug` — build Envoy static binary and run tests under `-c dbg`. +* `bazel.debug.server_only` — build Envoy static binary under `-c dbg`. * `bazel.dev` — build Envoy static binary and run tests under `-c fastbuild`. * `bazel.release` — build Envoy static binary and run tests under `-c opt`. * `bazel.release.server_only` — build Envoy static binary under `-c opt`. diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 1a8f3dd4aa0bc..0c966792c0be9 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -12,12 +12,23 @@ function bazel_release_binary_build() { cd "${ENVOY_CI_DIR}" bazel --batch build ${BAZEL_BUILD_OPTIONS} -c opt //source/exe:envoy-static.stripped.stamped # Copy the envoy-static binary somewhere that we can access outside of the - # container for building Docker images. + # container. cp -f \ "${ENVOY_CI_DIR}"/bazel-genfiles/source/exe/envoy-static.stripped.stamped \ "${ENVOY_DELIVERY_DIR}"/envoy } +function bazel_debug_binary_build() { + echo "Building..." + cd "${ENVOY_CI_DIR}" + bazel --batch build ${BAZEL_BUILD_OPTIONS} -c dbg //source/exe:envoy-static.stamped + # Copy the envoy-static binary somewhere that we can access outside of the + # container. + cp -f \ + "${ENVOY_CI_DIR}"/bazel-genfiles/source/exe/envoy-static.stamped \ + "${ENVOY_DELIVERY_DIR}"/envoy-debug +} + if [[ "$1" == "bazel.release" ]]; then echo "bazel release build with tests..." bazel_release_binary_build @@ -28,6 +39,16 @@ elif [[ "$1" == "bazel.release.server_only" ]]; then echo "bazel release build..." bazel_release_binary_build exit 0 +elif [[ "$1" == "bazel.debug" ]]; then + echo "bazel debug build with tests..." + bazel_debug_binary_build + echo "Testing..." + bazel --batch test ${BAZEL_TEST_OPTIONS} -c dbg //test/... + exit 0 +elif [[ "$1" == "bazel.debug.server_only" ]]; then + echo "bazel debug build..." + bazel_debug_binary_build + exit 0 elif [[ "$1" == "bazel.asan" ]]; then echo "bazel ASAN debug build with tests..." cd "${ENVOY_FILTER_EXAMPLE_SRCDIR}"