From bacbce7fd339cc7a5e589c87571ac2fce165e4a0 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Thu, 9 Apr 2020 11:51:01 -0700 Subject: [PATCH] Groom docker_build.sh (#318) * Groom docker_build.sh * more grooming, remove obsolete --- integrations/docker/docker_build.sh | 8 -------- integrations/docker/run_build.sh | 5 ++--- integrations/docker/run_docker_build.sh | 13 ++++++++----- 3 files changed, 10 insertions(+), 16 deletions(-) delete mode 100755 integrations/docker/docker_build.sh diff --git a/integrations/docker/docker_build.sh b/integrations/docker/docker_build.sh deleted file mode 100755 index af4a76f3f4801f..00000000000000 --- a/integrations/docker/docker_build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -e - -here=$(dirname "$0") - -MAKE_TARGET=${1:-all} - -docker run --rm -v "${PWD}/$here/../../..":/tmp/chip rsmmr/clang make -C /tmp/chip "${MAKE_TARGET}" diff --git a/integrations/docker/run_build.sh b/integrations/docker/run_build.sh index f1aa81434d0173..c07564f26951a7 100755 --- a/integrations/docker/run_build.sh +++ b/integrations/docker/run_build.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Note: this needs to be run from the root directory presently. -# https://github.com/project-chip/connectedhomeip/issues/273 +# This script assumes it's being run from the ToT -./bootstrap && mkdir -p build/default && (cd build/default && ../../configure --enable-coverage --enable-coverage-info) && make -C build/default distcheck +./bootstrap && mkdir -p build/default && (cd build/default && ../../configure --enable-coverage) && make -C build/default "${@:-distcheck}" diff --git a/integrations/docker/run_docker_build.sh b/integrations/docker/run_docker_build.sh index 7b04dc342b9a06..845ab1feb5923e 100755 --- a/integrations/docker/run_docker_build.sh +++ b/integrations/docker/run_docker_build.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash -# Note: this needs to be run from the root directory presently. -# https://github.com/project-chip/connectedhomeip/issues/273 set -e +here=$(cd "$(dirname "$0")" && pwd) +# update me if I move out of integrations/docker +# | +# +---------------+ +# V +SOURCE_PATH=$(cd "${here}/../.." && pwd) -VERSION=$(cat integrations/docker/images/chip-build/version) ORGANIZATION="connectedhomeip" IMAGE="chip-build" -TARGET_SOURCE_PATH="/var/source" +VERSION=$(cat "${here}/images/${IMAGE}/version") -docker run --rm -w $TARGET_SOURCE_PATH -v ${PWD}:$TARGET_SOURCE_PATH "$ORGANIZATION/$IMAGE:$VERSION" ./integrations/docker/run_build.sh +docker run --rm -w "${SOURCE_PATH}" -v "${SOURCE_PATH}:${SOURCE_PATH}" "${ORGANIZATION}/${IMAGE}:${VERSION}" integrations/docker/run_build.sh "${@:-distcheck}"