xunliu opened a new issue, #4266:
URL: https://github.com/apache/gravitino/issues/4266
### What would you like to be improved?
### Description
We will create a shell script (build.sh) that presents the user with a menu
of build options. The user can select the desired build option, and the script
will execute the corresponding build command. This reduces the need to manually
type out build commands, making the process more convenient and less
error-prone.
### Sample build.sh Script
```
#!/bin/bash
# Define build options
buildOptions=(
"Only compile and skip test: ./gradlew clean build -x test"
"Only execute Unit test and skip Integration test: ./gradlew test
-PskipITs"
"Run the integration tests in embedded mode: ./gradlew build -x test &&
./gradlew test -PskipTests -PtestMode=embedded"
"Run the integration tests in deploy mode: ./gradlew build -x test &&
./gradlew compileDistribution && ./gradlew test -PskipTests -PtestMode=deploy"
"Exit"
)
```
I think we can refer some build command of
1. https://github.com/apache/gravitino/tree/main/.github/workflows
2. https://github.com/apache/gravitino/blob/main/docs/how-to-build.md
3. https://github.com/apache/gravitino/blob/main/docs/how-to-test.md
```
# Display the selection menu
echo "Please choose a build option:"
PS3='Enter the number of your choice: ' # Set the PS3 prompt for select
# Use select to create the menu
select opt in "${buildOptions[@]}"
do
case $opt in
"Build Option A: make buildA")
echo "You chose Build Option A"
make buildA
;;
"Build Option B: make buildB")
echo "You chose Build Option B"
make buildB
;;
"Build Option C: make buildC")
echo "You chose Build Option C"
make buildC
;;
"Build Option D: make buildD")
echo "You chose Build Option D"
make buildD
;;
"Exit")
echo "Exiting"
break
;;
*)
echo "Invalid option, please choose again"
;;
esac
done
```
### How to Use
1. Run the Script
Execute the script:
```
./build.sh
```
### Explanation
+ Define Build Options:
The buildOptions array contains the list of build options, along with the
commands that should be executed for each option.
+ Selection Menu:
The PS3 variable sets the prompt for the select command. The select command
creates a loop with a menu that allows the user to choose an option by entering
its corresponding number.
+ Case Statement:
The case statement executes the command associated with the selected option.
For each option, the script executes the relevant build command.
+ Exit Option:
The Exit option allows the user to quit the script.
+ Example Build Commands
In this example, the build commands are make buildA, make buildB, make
buildC, and make buildD. You can replace these commands with whatever build
commands are relevant to your project.
This script significantly simplifies the process of executing different
build commands and ensures that users only need to input the number
corresponding to their desired task, reducing the potential for error and
saving time.
### How should we improve?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]