From 05690f8339306a87fbe3fa3ebada00c7f5539419 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Tue, 4 Jun 2024 16:33:40 +0530 Subject: [PATCH] chore: Fail early when build of one component fails (#33958) Fail early when build of one of the components fails, instead of proceeding to build the Docker image and failing _much_ later. [Slack conversation](https://theappsmith.slack.com/archives/C02MUD8DNUR/p1717484636886919). ## Summary by CodeRabbit - **Chores** - Improved the build process with better error handling for server, client, and RTS components, ensuring clearer messaging in case of build failures. --- scripts/local_testing.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/local_testing.sh b/scripts/local_testing.sh index 31766c1538..f9b5f406db 100755 --- a/scripts/local_testing.sh +++ b/scripts/local_testing.sh @@ -79,15 +79,32 @@ fi pretty_print "Starting server build ..." -pushd app/server > /dev/null && ./build.sh -DskipTests > /dev/null && pretty_print "Server build successful. Starting client build ..." +pushd app/server > /dev/null +if ! ./build.sh -DskipTests > /dev/null; then + echo Server build failed >&2 + exit 1 +fi +pretty_print "Server build successful. Starting client build ..." popd -pushd app/client > /dev/null && yarn > /dev/null && yarn build > /dev/null && pretty_print "Client build successful. Starting RTS build ..." +pushd app/client > /dev/null +yarn > /dev/null +if ! yarn build > /dev/null; then + echo Client build failed >&2 + exit 1 +fi +pretty_print "Client build successful. Starting RTS build ..." popd -pushd app/client/packages/rts/ > /dev/null && ./build.sh > /dev/null && pretty_print "RTS build successful. Starting Docker build ..." +pushd app/client/packages/rts/ > /dev/null +if ! ./build.sh > /dev/null; then + echo RTS build failed >&2 + exit 1 +fi +pretty_print "RTS build successful. Starting Docker build ..." popd +bash "$(dirname "$0")/generate_info_json.sh" docker build -t appsmith/appsmith-ce:local-testing \ --build-arg BASE="appsmith/base-$edition:release" \ --build-arg APPSMITH_CLOUD_SERVICES_BASE_URL="${cs_url:-https://release-cs.appsmith.com}" \