From 8dcbfe55426baf6f27281ec64e10423abf709923 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 14 Mar 2019 13:12:07 -0400 Subject: [PATCH] fix: correct case where there could be multiple build containers post-build This happens when we execute several post-release scripts. --- tests/unit/20_build-env.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/20_build-env.bats b/tests/unit/20_build-env.bats index 688d088a0..48e2626b0 100644 --- a/tests/unit/20_build-env.bats +++ b/tests/unit/20_build-env.bats @@ -74,7 +74,7 @@ teardown() { @test "(build-env) DOKKU_ROOT cache bind is used by default" { deploy_app - BUILD_CID=$(docker ps -a |grep $TEST_APP |grep /bin/bash | awk '{print $1}') + BUILD_CID=$(docker ps -a | grep $TEST_APP | grep /bin/bash | awk '{print $1}' | head -n1) run /bin/bash -c "docker inspect --format '{{ .HostConfig.Binds }}' $BUILD_CID | tr -d '[]' | cut -f1 -d:" echo "output: $output" echo "status: $status" @@ -87,7 +87,7 @@ teardown() { echo export DOKKU_HOST_ROOT="$TMP_ROOT" > $DOKKU_ROOT/.dokkurc/HOST_ROOT DOKKU_HOST_ROOT="$TMP_ROOT" deploy_app - BUILD_CID=$(docker ps -a |grep $TEST_APP |grep /bin/bash | awk '{print $1}') + BUILD_CID=$(docker ps -a | grep $TEST_APP | grep /bin/bash | awk '{print $1}') run /bin/bash -c "docker inspect --format '{{ .HostConfig.Binds }}' $BUILD_CID | tr -d '[]' | cut -f1 -d:" echo "output: $output" echo "status: $status"