forked from freeleaps/freeleaps-pub
Update for support chat
This commit is contained in:
parent
20cfc792b0
commit
f9f4811549
@ -803,7 +803,54 @@ devbox_init_command() {
|
|||||||
# record container id, DEVBOX_FRONTEND_PORT, DEVBOX_BACKEND_PORT
|
# record container id, DEVBOX_FRONTEND_PORT, DEVBOX_BACKEND_PORT
|
||||||
echo "$container_id" > "$WORKING_HOME/.devbox-instance"
|
echo "$container_id" > "$WORKING_HOME/.devbox-instance"
|
||||||
echo "$DEVBOX_FRONTEND_PORT" > "$WORKING_HOME/.devbox-frontend-port"
|
echo "$DEVBOX_FRONTEND_PORT" > "$WORKING_HOME/.devbox-frontend-port"
|
||||||
echo "$DEVBOX_BACKEND_PORT" > "$WORKING_HOME/.devbox-backend-port"
|
echo "$DEVBOX_BACKEND_PORT" > "$WORKING_HOME/.devbox-backend-port"]
|
||||||
|
|
||||||
|
# Check if username and password are set
|
||||||
|
if [[ -z "$FREELEAPS_USERNAME" || -z "$FREELEAPS_PASSWORD" ]]; then
|
||||||
|
echo "Warining: Username and password are required to pull freeleaps.com code."
|
||||||
|
echo "==> [INIT] DevBox environment initialization completed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test if the user can access the freeleaps.com repository
|
||||||
|
echo "==> Testing access to freeleaps.com repository..."
|
||||||
|
if ! git ls-remote "https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" &>/dev/null; then
|
||||||
|
echo "ERROR: Failed to access freeleaps.com repository. Please check your username and password."
|
||||||
|
echo "==> [INIT] DevBox environment initialization completed successfully, but access to the freeleaps.com repository failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DOVBOX_CLI_DIR=$(pwd)
|
||||||
|
|
||||||
|
FREELEAPS_DIR="$WORKING_HOME/freeleaps"
|
||||||
|
FRONTEND_GIT_URL="https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git"
|
||||||
|
# Check if freeleaps2-frontend exists, if not git clone it
|
||||||
|
if [ ! -d "$FREELEAPS_DIR" ]; then
|
||||||
|
pushd "$WORKING_HOME" > /dev/null
|
||||||
|
echo "Git cloning freeleaps.com:3443/products/freeleaps.git 1"
|
||||||
|
git clone --depth 5 $FRONTEND_GIT_URL
|
||||||
|
else
|
||||||
|
echo "Git pulling 2"
|
||||||
|
pushd "$FREELEAPS_DIR" > /dev/null
|
||||||
|
# Check $WORKING_HOME/freeleaps exists and it is a git repository, if not git clone it
|
||||||
|
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||||
|
popd > /dev/null # Exit from $FREELEAPS_DIR
|
||||||
|
rm -rf "$FREELEAPS_DIR" # Remove $FREELEAPS_DIR
|
||||||
|
rmdir "$FREELEAPS_DIR" # Remove $FREELEAPS_DIR
|
||||||
|
|
||||||
|
# Git clone freeleaps.com:3443/products/freeleaps.git
|
||||||
|
echo "Cloning repository again: $FRONTEND_GIT_URL"
|
||||||
|
sudo chown -R "$OWNER_GROUP" "$WORKING_HOME"
|
||||||
|
git clone --depth 5 "$FRONTEND_GIT_URL"
|
||||||
|
else
|
||||||
|
echo "Git pulling freeleaps.com:3443/products/freeleaps.git"
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $DOVBOX_CLI_DIR > /dev/null
|
||||||
|
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
# 6. linbwang: pull and start other components
|
# 6. linbwang: pull and start other components
|
||||||
@ -824,7 +871,7 @@ if [[ $USE_LOCAL_COMPONENT_VAL == true ]]; then
|
|||||||
export AUTHENTICATION_IMAGE_TAG="$AUTHENTICATION_TAG"
|
export AUTHENTICATION_IMAGE_TAG="$AUTHENTICATION_TAG"
|
||||||
export NOTIFICATION_IMAGE_TAG="$NOTIFICATION_TAG"
|
export NOTIFICATION_IMAGE_TAG="$NOTIFICATION_TAG"
|
||||||
export CHAT_IMAGE_TAG="$CHAT_TAG"
|
export CHAT_IMAGE_TAG="$CHAT_TAG"
|
||||||
|
|
||||||
# Check if gitea_data_backup.tar.gz exists at current script directory, if not exit
|
# Check if gitea_data_backup.tar.gz exists at current script directory, if not exit
|
||||||
if [[ ! -f "gitea_data_backup.tar.gz" ]]; then
|
if [[ ! -f "gitea_data_backup.tar.gz" ]]; then
|
||||||
echo "ERROR: gitea_data_backup.tar.gz not found. Please make sure it exists in the current directory."
|
echo "ERROR: gitea_data_backup.tar.gz not found. Please make sure it exists in the current directory."
|
||||||
@ -866,6 +913,8 @@ if [[ $USE_LOCAL_COMPONENT_VAL == true ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Start Gitea, MongoDB, RabbitMQ and other components containers
|
# Start Gitea, MongoDB, RabbitMQ and other components containers
|
||||||
echo "===> start Gitea, MongoDB, RabbitMQ and other components containers"
|
echo "===> start Gitea, MongoDB, RabbitMQ and other components containers"
|
||||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq gitea "${start_components[@]}"
|
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq gitea "${start_components[@]}"
|
||||||
@ -945,49 +994,6 @@ fi
|
|||||||
|
|
||||||
IS_START_FRONTEND=true
|
IS_START_FRONTEND=true
|
||||||
|
|
||||||
# Check if username and password are set
|
|
||||||
if [[ -z "$FREELEAPS_USERNAME" || -z "$FREELEAPS_PASSWORD" ]]; then
|
|
||||||
echo "Warining: Username and password are required to pull freeleaps.com code."
|
|
||||||
echo "==> [INIT] DevBox environment initialization completed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Test if the user can access the freeleaps.com repository
|
|
||||||
echo "==> Testing access to freeleaps.com repository..."
|
|
||||||
if ! git ls-remote "https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" &>/dev/null; then
|
|
||||||
echo "ERROR: Failed to access freeleaps.com repository. Please check your username and password."
|
|
||||||
echo "==> [INIT] DevBox environment initialization completed successfully, but access to the freeleaps.com repository failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FREELEAPS_DIR="$WORKING_HOME/freeleaps"
|
|
||||||
FRONTEND_GIT_URL="https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git"
|
|
||||||
# Check if freeleaps2-frontend exists, if not git clone it
|
|
||||||
if [ ! -d "$FREELEAPS_DIR" ]; then
|
|
||||||
echo "Git cloning freeleaps.com:3443/products/freeleaps.git"
|
|
||||||
git clone --depth 5 $FRONTEND_GIT_URL
|
|
||||||
else
|
|
||||||
pushd "$FREELEAPS_DIR" > /dev/null
|
|
||||||
# Check $WORKING_HOME/freeleaps exists and it is a git repository, if not git clone it
|
|
||||||
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
|
|
||||||
popd > /dev/null # Exit from $FREELEAPS_DIR
|
|
||||||
rm -rf "$FREELEAPS_DIR" # Remove $FREELEAPS_DIR
|
|
||||||
ls -la "$WORKING_HOME"
|
|
||||||
rmdir "$FREELEAPS_DIR" # Remove $FREELEAPS_DIR
|
|
||||||
ls -la "$WORKING_HOME"
|
|
||||||
|
|
||||||
# Git clone freeleaps.com:3443/products/freeleaps.git
|
|
||||||
echo "Cloning repository again: $FRONTEND_GIT_URL"
|
|
||||||
sudo chown -R "$OWNER_GROUP" "$WORKING_HOME"
|
|
||||||
git clone --depth 5 "$FRONTEND_GIT_URL"
|
|
||||||
else
|
|
||||||
echo "Git pulling freeleaps.com:3443/products/freeleaps.git"
|
|
||||||
git pull
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Run banckend service and frontend service in the container
|
# Run banckend service and frontend service in the container
|
||||||
docker exec -i "$DEVBOX_NAME" bash <<EOF
|
docker exec -i "$DEVBOX_NAME" bash <<EOF
|
||||||
|
|||||||
@ -251,8 +251,9 @@ services:
|
|||||||
target: /app/log/payment
|
target: /app/log/payment
|
||||||
chat:
|
chat:
|
||||||
container_name: chat
|
container_name: chat
|
||||||
image: freeleaps/chat:${CHAT_IMAGE_TAG:-latest-linux-arm64}
|
build:
|
||||||
platform: linux/${ARCH:-arm64}
|
context: ${WORKING_HOME}/freeleaps/apps
|
||||||
|
dockerfile: ${WORKING_HOME}/freeleaps/apps/chat/Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
- mongodb
|
||||||
|
|||||||
1
devbox/devbox.local/cli/freeleaps
Submodule
1
devbox/devbox.local/cli/freeleaps
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit ca58e0b8f9d91c297da64c440b799ff913cb24f2
|
||||||
Loading…
Reference in New Issue
Block a user