Update for change local component service config url and update frontend init commands

This commit is contained in:
Tianyong Qiu 2025-02-19 01:28:13 +08:00
parent 5f3b149e59
commit 9b2c914736

View File

@ -935,11 +935,11 @@ if [[ \$USE_LOCAL_COMPONENT_VAL == true ]]; then
export STRIPE_WEBHOOK_SECRET=whsec_S6ZWjSAdR5Cpsn2USH6ZRBqbdBIENjTC export STRIPE_WEBHOOK_SECRET=whsec_S6ZWjSAdR5Cpsn2USH6ZRBqbdBIENjTC
export STRIPE_ACCOUNT_WEBHOOK_SECRET=whsec_PgPnkWGhEUiQfnV8aIb5Wmruz7XETJLm export STRIPE_ACCOUNT_WEBHOOK_SECRET=whsec_PgPnkWGhEUiQfnV8aIb5Wmruz7XETJLm
export SITE_URL_ROOT=http://localhost export SITE_URL_ROOT=http://localhost
export FREELEAPS_DEVSVC_ENDPOINT=http://localhost:8007/api/devsvc/ export FREELEAPS_DEVSVC_ENDPOINT=http://devsvc:8007/api/devsvc/
export FREELEAPS_CONTENT_ENDPOINT=http://localhost:8013/api/content/ export FREELEAPS_CONTENT_ENDPOINT=http://content:8013/api/content/
export FREELEAPS_NOTIFICATION_ENDPOINT=http://localhost:8003/api/notification/ export FREELEAPS_NOTIFICATION_ENDPOINT=http://notification:8003/api/notification/
export FREELEAPS_CENTRAL_STORAGE_ENDPOINT=http://localhost:8005/api/central_storage/ export FREELEAPS_CENTRAL_STORAGE_ENDPOINT=http://central_storage:8005/api/central_storage/
export FREELEAPS_AUTHENTICATION_ENDPOINT=http://localhost:8004/api/auth/ export FREELEAPS_AUTHENTICATION_ENDPOINT=http://authentication:8004/api/auth/
export FREELEAPS_AILAB_ENDPOINT=https://localhost:8009/api/ export FREELEAPS_AILAB_ENDPOINT=https://localhost:8009/api/
export KAFKA_SERVER_URL='' export KAFKA_SERVER_URL=''
export JWT_SECRET_KEY=8f87ca8c3c9c3df09a9c78e0adb0927855568f6072d9efc892534aee35f5867b export JWT_SECRET_KEY=8f87ca8c3c9c3df09a9c78e0adb0927855568f6072d9efc892534aee35f5867b
@ -1089,13 +1089,25 @@ else
export VITE_PROXY_API_CHAT_URL='https://freeleaps-alpha.com' export VITE_PROXY_API_CHAT_URL='https://freeleaps-alpha.com'
fi fi
npm install
npm update npm update
# 1⃣ Install pnpm globally
npm install -g pnpm npm install -g pnpm
pnpm install
# 2⃣ Verify installation
pnpm --version
# 3⃣ Clean up old dependencies
rm -rf node_modules pnpm-lock.yaml
# 4⃣ Install dependencies (ensuring lockfile updates)
pnpm install --no-frozen-lockfile
# 5⃣ Build the project
npm run build npm run build
# 6⃣ Format the code (Optional)
npm run format npm run format
# Start the frontend service with nohup in order to keep it running after the SSH session is closed. Save the process ID of the frontend service # Start the frontend service with nohup in order to keep it running after the SSH session is closed. Save the process ID of the frontend service
nohup npm run dev > /home/.devbox/logs/frontend.logs 2>&1 & nohup npm run dev > /home/.devbox/logs/frontend.logs 2>&1 &
@ -1181,25 +1193,6 @@ devbox_deinit_command() {
echo "==> Starting DevBox deinitialization..." echo "==> Starting DevBox deinitialization..."
# Clear the DevBox container logs
if [[ "$CLEAR_LOGS" == "true" ]]; then
echo "==> Clearing logs in $WORKING_HOME/logs..."
sudo chown -R $(whoami):$(whoami) "$WORKING_HOME/logs"
rm -rf "$WORKING_HOME/logs"/* 2>/dev/null || true
else
echo "==> Skipping log clearing."
fi
# Clear the source repository
if [[ "$CLEAR_REPO" == "true" && -d "$WORKING_HOME/freeleaps" ]]; then
echo "==> Deleting source repository at $WORKING_HOME/freeleaps"
sudo chown -R $(whoami):$(whoami) "$WORKING_HOME/freeleaps"
rm -rf "$WORKING_HOME/freeleaps"
rmdir "$WORKING_HOME" 2>/dev/null || true
else
echo "==> Skipping repository deletion."
fi
# Stop and remove DevBox container # Stop and remove DevBox container
if [[ -f "$WORKING_HOME/.devbox-instance" ]]; then if [[ -f "$WORKING_HOME/.devbox-instance" ]]; then
local container_id local container_id
@ -1260,6 +1253,27 @@ devbox_deinit_command() {
fi fi
done done
# Clear the DevBox container logs
if [[ "$CLEAR_LOGS" == "true" ]]; then
echo "==> Clearing logs in $WORKING_HOME/logs..."
sudo chown -R $(whoami):$(whoami) "$WORKING_HOME/logs"
rm -rf "$WORKING_HOME/logs" 2>/dev/null || true
mkdir -p "$WORKING_HOME/logs" 2>/dev/null || true
else
echo "==> Skipping log clearing."
fi
# Clear the source repository
if [[ "$CLEAR_REPO" == "true" && -d "$WORKING_HOME/freeleaps" ]]; then
echo "==> Deleting source repository at $WORKING_HOME/freeleaps"
sudo chown -R $(whoami):$(whoami) "$WORKING_HOME/freeleaps"
rm -rf "$WORKING_HOME/freeleaps" 2>/dev/null || true
rmdir "$WORKING_HOME/freeleaps" 2>/dev/null || true
else
echo "==> Skipping repository deletion."
fi
# Remove the use-local-component file # Remove the use-local-component file
rm -f "$WORKING_HOME/.use-local-component" rm -f "$WORKING_HOME/.use-local-component"