chore: Add support for custom CS URL in local_testing.sh script (#25927)

Slack thread with details:
https://theappsmith.slack.com/archives/CGBPVEJ5C/p1690917878540839?thread_ts=1690866395.690119&cid=CGBPVEJ5C
This commit is contained in:
Shrikant Sharat Kandula 2023-08-02 11:46:28 +05:30 committed by GitHub
parent b535aa2fc8
commit 24ee7f777f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ display_help()
echo "If --local or -l is passed, it will build with local changes"
echo "---------------------------------------------------------------------------------------"
echo
echo "Syntax: $0 [-h] [-l] [-r [remote_url]] [branch_name]"
echo "Syntax: $0 [-h] [-l] [-r [remote_url]] [branch_name] [cs_url]"
echo "options:"
echo "-h Print this help"
echo "-l or --local Use the local codebase and not git"
@ -35,7 +35,7 @@ then
fi
LOCAL=false
if [[ ($@ == "--local" || $@ == "-l")]]
if [[ ($1 == "--local" || $1 == "-l")]]
then
LOCAL=true
fi
@ -50,6 +50,7 @@ if [[ ($LOCAL == true) ]]
then
pretty_print "Setting up instance with local changes"
BRANCH=release
cs_url=$2
elif [[ ($REMOTE == true) ]]
then
pretty_print "Setting up instance with remote repository branch ..."
@ -62,6 +63,7 @@ then
git pull remote_origin_for_local_test $REMOTE_BRANCH
else
BRANCH=$1
cs_url=$2
pretty_print "Setting up instance to run on branch: $BRANCH"
cd "$(dirname "$0")"/..
git fetch origin $BRANCH
@ -81,7 +83,8 @@ popd
pushd app/client/packages/rts/ > /dev/null && ./build.sh > /dev/null && pretty_print "RTS build successful. Starting Docker build ..."
popd
docker build -t appsmith/appsmith-ce:local-testing . > /dev/null && pretty_print "Docker image build successful. Triggering run now ..."
docker build -t appsmith/appsmith-ce:local-testing --build-arg APPSMITH_CLOUD_SERVICES_BASE_URL="${cs_url:-https://release-cs.appsmith.com}" . > /dev/null
pretty_print "Docker image build successful. Triggering run now ..."
(docker stop appsmith || true) && (docker rm appsmith || true)
docker run -d --name appsmith -p 80:80 -v "$PWD/stacks:/appsmith-stacks" appsmith/appsmith-ce:local-testing && sleep 15 && pretty_print "Local instance is up! Open Appsmith at http://localhost! "