forked from freeleaps/freeleaps-pub
Merged PR 36: Update for code cleanup
1. Clean up the `cli` folder after an incorrect Freeleaps code upload. 2. Fix missing product ID user input when running `./devbox` alone. 3. Update for devbox -h usage description
This commit is contained in:
commit
ffa9d821a2
@ -94,6 +94,16 @@ devbox_init_guidance() {
|
|||||||
add_arg "--use-custom-repository" "$use_custom_repository"
|
add_arg "--use-custom-repository" "$use_custom_repository"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
# Check if product_id is empty
|
||||||
|
if [[ -z $product_id ]]; then
|
||||||
|
# Ask user for product_id
|
||||||
|
read -p "Enter your product_id: " product_id
|
||||||
|
if [[ -z $product_id ]]; then
|
||||||
|
printf "Product ID is required.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Ask user for Freeleaps.com username and password
|
# Ask user for Freeleaps.com username and password
|
||||||
read -p "Enter your Freeleaps.com username: " freeleaps_username
|
read -p "Enter your Freeleaps.com username: " freeleaps_username
|
||||||
read -s -p "Enter your Freeleaps.com password: " freeleaps_password
|
read -s -p "Enter your Freeleaps.com password: " freeleaps_password
|
||||||
@ -112,7 +122,7 @@ devbox_init_guidance() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Repository connection successful.\n"
|
printf "Repository connection successfully.\n"
|
||||||
|
|
||||||
add_arg "--use-custom-repository" "$use_custom_repository"
|
add_arg "--use-custom-repository" "$use_custom_repository"
|
||||||
;;
|
;;
|
||||||
@ -128,16 +138,39 @@ devbox_usage() {
|
|||||||
printf "Command\n"
|
printf "Command\n"
|
||||||
printf " devbox : DevBox Command Line Tool for managing the local development environment.\n\n"
|
printf " devbox : DevBox Command Line Tool for managing the local development environment.\n\n"
|
||||||
|
|
||||||
|
printf "Usage\n"
|
||||||
|
printf " devbox : Interactive mode to initialize development environment\n"
|
||||||
|
printf " devbox freeleaps : Initialize Freeleaps.com development environment\n"
|
||||||
|
printf " devbox <product_id> : Initialize specific product development environment\n\n"
|
||||||
|
|
||||||
printf "Arguments\n"
|
printf "Arguments\n"
|
||||||
printf " COMMAND [Required] : Specify the command to execute (e.g., init, deinit, start, stop, status, restart).\n\n"
|
printf " COMMAND [Required] : Specify the command to execute.\n"
|
||||||
|
printf " init, i : Initialize the local development environment.\n"
|
||||||
|
printf " deinit, d : De-initialize the local development environment.\n"
|
||||||
|
printf " start, s : Start services in the local development environment.\n"
|
||||||
|
printf " stop, p : Stop services in the local development environment.\n"
|
||||||
|
printf " status, t : Display status of services in the local environment.\n"
|
||||||
|
printf " restart, r : Restart services in the local environment.\n\n"
|
||||||
|
|
||||||
printf "Global Arguments\n"
|
printf "Global Arguments\n"
|
||||||
printf " --help, -h : Show this help message and exit.\n"
|
printf " --help, -h : Show this help message and exit.\n"
|
||||||
printf " --version, -v : Show version number.\n\n"
|
printf " --version, -v : Show version number.\n\n"
|
||||||
|
|
||||||
printf "Examples\n"
|
printf "Examples\n"
|
||||||
|
printf " Initialize development environment interactively:\n"
|
||||||
|
printf " devbox\n\n"
|
||||||
|
printf " Initialize Freeleaps.com development environment:\n"
|
||||||
|
printf " devbox freeleaps\n\n"
|
||||||
|
printf " Initialize specific product development environment:\n"
|
||||||
|
printf " devbox <product_id>\n\n"
|
||||||
|
printf " Initialize development environment with command:\n"
|
||||||
|
printf " devbox init\n\n"
|
||||||
printf " Display help for the 'init' command:\n"
|
printf " Display help for the 'init' command:\n"
|
||||||
printf " devbox init --help\n\n"
|
printf " devbox init --help\n\n"
|
||||||
|
printf " Start all services:\n"
|
||||||
|
printf " devbox start\n\n"
|
||||||
|
printf " Start specific service:\n"
|
||||||
|
printf " devbox start --component=backend\n\n"
|
||||||
printf " Display version information:\n"
|
printf " Display version information:\n"
|
||||||
printf " devbox --version\n"
|
printf " devbox --version\n"
|
||||||
echo
|
echo
|
||||||
@ -559,7 +592,6 @@ get_port() {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "$port"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build the local image
|
# Build the local image
|
||||||
@ -1070,7 +1102,7 @@ if [[ $USE_LOCAL_COMPONENT_VAL == true ]]; then
|
|||||||
|
|
||||||
# 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 redis "${start_components[@]}"
|
docker-compose -f docker-compose.yaml up -d mongodb rabbitmq gitea redis "${start_components[@]}"
|
||||||
|
|
||||||
gitea_container_id=$(docker ps --no-trunc -a --filter "name=^freeleaps2-gitea$" --format "{{.ID}}")
|
gitea_container_id=$(docker ps --no-trunc -a --filter "name=^freeleaps2-gitea$" --format "{{.ID}}")
|
||||||
echo "$gitea_container_id" > "$WORKING_HOME/.gitea-instance"
|
echo "$gitea_container_id" > "$WORKING_HOME/.gitea-instance"
|
||||||
@ -1112,7 +1144,7 @@ else
|
|||||||
echo ' ===> Using online components for Freeleaps services.'
|
echo ' ===> Using online components for Freeleaps services.'
|
||||||
echo '============================================'
|
echo '============================================'
|
||||||
# Start Gitea, MongoDB, RabbitMQ containers
|
# Start Gitea, MongoDB, RabbitMQ containers
|
||||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq redis
|
docker-compose -f docker-compose.yaml up -d mongodb rabbitmq redis
|
||||||
|
|
||||||
# Save MongoDB and RabbitMQ container ids to .mongodb-instance and .rabbitmq-instance
|
# Save MongoDB and RabbitMQ container ids to .mongodb-instance and .rabbitmq-instance
|
||||||
mongo_container_id=$(docker ps -a --format '{{.Names}}' | grep "^freeleaps2-mongodb\$")
|
mongo_container_id=$(docker ps -a --format '{{.Names}}' | grep "^freeleaps2-mongodb\$")
|
||||||
@ -1781,6 +1813,7 @@ if [[ "${START_FRONTEND}" == "true" ]]; then
|
|||||||
git status -s > "\$baseline_file"
|
git status -s > "\$baseline_file"
|
||||||
echo "==> Baseline file created: \$baseline_file"
|
echo "==> Baseline file created: \$baseline_file"
|
||||||
|
|
||||||
|
|
||||||
# Check if the frontend service is already running according to the package.json and pnpm-lock.yaml files timestamps
|
# Check if the frontend service is already running according to the package.json and pnpm-lock.yaml files timestamps
|
||||||
if [[ ! -d "node_modules" || "package.json" -nt "node_modules" || "pnpm-lock.yaml" -nt "node_modules" ]]; then
|
if [[ ! -d "node_modules" || "package.json" -nt "node_modules" || "pnpm-lock.yaml" -nt "node_modules" ]]; then
|
||||||
echo "==> Installing/Updating frontend dependencies..."
|
echo "==> Installing/Updating frontend dependencies..."
|
||||||
@ -2386,7 +2419,6 @@ parse_requirements() {
|
|||||||
"")
|
"")
|
||||||
devbox_init_guidance >&2
|
devbox_init_guidance >&2
|
||||||
action="init"
|
action="init"
|
||||||
shift
|
|
||||||
devbox_init_parse_requirements "$@"
|
devbox_init_parse_requirements "$@"
|
||||||
shift $#
|
shift $#
|
||||||
;;
|
;;
|
||||||
@ -1 +0,0 @@
|
|||||||
Subproject commit ca58e0b8f9d91c297da64c440b799ff913cb24f2
|
|
||||||
Loading…
Reference in New Issue
Block a user