Skip to content

Commit

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

* Fail fast when image build fails on tests kubeflow#11102

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

* Fail fast when image build fails on tests kubeflow#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
2 people authored and R3hankhan123 committed Sep 20, 2024
1 parent 5d68c26 commit 35aa091
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 35aa091

Please sign in to comment.