Skip to content

Commit

Permalink
Make failing docker commands fail the setup script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thpierce committed Feb 8, 2024
1 parent 7aec5ae commit 2cdcf29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contract-tests/set-up-contract-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ rm -rf dist/contract_tests*
# Create mock-collector image
cd contract-tests/images/mock-collector
docker build . -t aws-appsignals-mock-collector-python
if [ $? = 1 ]; then
echo "Docker build for mock collector failed"
exit 1
fi

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

# Build and install mock-collector
Expand Down

0 comments on commit 2cdcf29

Please sign in to comment.