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).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Shrikant Sharat Kandula 2024-06-04 16:33:40 +05:30 committed by GitHub
parent 9cd1be5014
commit 05690f8339
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}" \