Skip to content

Commit

Permalink
Update build script for docker to not need to guess in advance a corr…
Browse files Browse the repository at this point in the history
…ect docker path (#23802)
  • Loading branch information
andy31415 authored and pull[bot] committed Jul 11, 2023
1 parent 64d4f7f commit 1300800
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions integrations/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ set -ex

[[ -n $VERSION ]] || die "version cannot be empty"

mb_space_before=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}')
if [ -f "$DOCKER_VOLUME_PATH" ]; then
mb_space_before=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}')
fi

# go find and build any CHIP images this image is "FROM"
awk -F/ '/^FROM connectedhomeip/ {print $2}' Dockerfile | while read -r dep; do
Expand Down Expand Up @@ -98,9 +100,10 @@ docker image prune --force
}

docker images --filter=reference="$ORG/*"
df -h "$DOCKER_VOLUME_PATH"
mb_space_after=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}')

printf "%'.f MB total used\n" "$((mb_space_before - mb_space_after))"
if [ -f "$DOCKER_VOLUME_PATH" ]; then
df -h "$DOCKER_VOLUME_PATH"
mb_space_after=$(df -m "$DOCKER_VOLUME_PATH" | awk 'FNR==2{print $3}')
printf "%'.f MB total used\n" "$((mb_space_before - mb_space_after))"
fi

exit 0

0 comments on commit 1300800

Please sign in to comment.