Update for check git repo freeleaps.com user&password access

This commit is contained in:
Tianyong Qiu 2025-02-14 16:22:48 +08:00
parent b56dc31882
commit 63f3158f04

View File

@ -1118,6 +1118,14 @@ if [[ -z "$FREELEAPS_USERNAME" || -z "$FREELEAPS_PASSWORD" ]]; then
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."
echo "==> [INIT] DevBox environment initialization completed."
exit 1
fi
# Check if freeleaps2-frontend exists, if not git clone it
if [ ! -d $WORKING_HOME/freeleaps ]; then
echo "Git cloning freeleaps.com:3443/products/freeleaps.git"
@ -1395,8 +1403,8 @@ devbox_deinit_command() {
# 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
ls -l "$WORKING_HOME/logs"
else
echo "==> Skipping log clearing."
fi
@ -1404,6 +1412,7 @@ devbox_deinit_command() {
# 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"
else
echo "==> Skipping repository deletion."