Skip to content

Commit 7d65a8b

Browse files
committed
Make failing docker commands fail the setup script
When docker build fails, it does so silently. We have to detect the failure with the bash variable $?, then exit the script. This avoids silent docker failures.
1 parent 6889df6 commit 7d65a8b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contract-tests/set-up-contract-tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ rm -rf dist/contract_tests*
1414
# Create mock-collector image
1515
cd contract-tests/images/mock-collector
1616
docker build . -t aws-appsignals-mock-collector-python
17+
if [ $? = 1 ]; then
18+
echo "Docker build for mock collector failed"
19+
exit 1
20+
fi
1721

1822
# Find and store aws_opentelemetry_distro whl file
1923
cd ../../../dist
@@ -29,6 +33,10 @@ for dir in contract-tests/images/applications/*
2933
do
3034
application="${dir##*/}"
3135
docker build . -t aws-appsignals-tests-${application}-app -f ${dir}/Dockerfile --build-arg="DISTRO=${DISTRO}"
36+
if [ $? = 1 ]; then
37+
echo "Docker build for ${application} application failed"
38+
exit 1
39+
fi
3240
done
3341

3442
# Build and install mock-collector

0 commit comments

Comments
 (0)