ToolJet/docker/LTS/cloud/cloud-entrypoint.sh
Adish M 5f3ffad6bf
Changing folder for LTS and pre-release (#13666)
* Changing folder for LTS and pre-release

* correction in entrypoint path in pre-release dockerfile

* made change to render PR workflow to pickup the dockerfile according to branch
2025-08-05 12:28:01 +05:30

31 lines
688 B
Bash
Executable file

#!/bin/bash
set -e
npm cache clean --force
if [ -d "./server/dist" ]; then
SETUP_CMD='npm run cloud:setup:prod'
else
SETUP_CMD='npm run cloud:setup'
fi
npm cache clean --force
if [ -f "./.env" ]; then
declare $(grep -v '^#' ./.env | xargs)
fi
if [ -z "$DATABASE_URL" ]; then
./server/scripts/wait-for-it.sh $PG_HOST:${PG_PORT:-5432} --strict --timeout=300 -- $SETUP_CMD
else
PG_HOST=$(echo "$DATABASE_URL" | awk -F'[/:@?]' '{print $6}')
PG_PORT=$(echo "$DATABASE_URL" | awk -F'[/:@?]' '{print $7}')
if [ -z "$DATABASE_PORT" ]; then
DATABASE_PORT="5432"
fi
./server/scripts/wait-for-it.sh "$PG_HOST:$PG_PORT" --strict --timeout=300 -- $SETUP_CMD
fi
exec "$@"