Skip to content

Commit

Permalink
test: Fail fast when image build fails on tests #11102 (#11115)
Browse files Browse the repository at this point in the history
* Fail fast when image build fails on tests #11102

Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>

* Fail fast when image build fails on tests #11102

Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>

---------

Signed-off-by: Elay Aharoni (EXT-Nokia) <[email protected]>
Co-authored-by: Elay Aharoni (EXT-Nokia) <[email protected]>
  • Loading branch information
ElayAharoni and Elay Aharoni (EXT-Nokia) authored Aug 20, 2024
1 parent 36cf066 commit 120a908
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions scripts/deploy/github/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,31 @@ set -e

REGISTRY="${REGISTRY:-kind-registry:5000}"
TAG="${TAG:-latest}"
EXIT_CODE=0

docker system prune -a -f

docker build -q -t "${REGISTRY}/apiserver:${TAG}" -f backend/Dockerfile . && docker push "${REGISTRY}/apiserver:${TAG}" &
docker build -q -t "${REGISTRY}/persistenceagent:${TAG}" -f backend/Dockerfile.persistenceagent . && docker push "${REGISTRY}/persistenceagent:${TAG}" &
docker build -q -t "${REGISTRY}/scheduledworkflow:${TAG}" -f backend/Dockerfile.scheduledworkflow . && docker push "${REGISTRY}/scheduledworkflow:${TAG}" &
docker build -q -t "${REGISTRY}/apiserver:${TAG}" -f backend/Dockerfile . && docker push "${REGISTRY}/apiserver:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build apiserver image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/persistenceagent:${TAG}" -f backend/Dockerfile.persistenceagent . && docker push "${REGISTRY}/persistenceagent:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build persistenceagent image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/scheduledworkflow:${TAG}" -f backend/Dockerfile.scheduledworkflow . && docker push "${REGISTRY}/scheduledworkflow:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build scheduledworkflow image."
exit $EXIT_CODE
fi

wait

# clean up intermittent build caches to free up disk space
docker system prune -a -f

0 comments on commit 120a908

Please sign in to comment.