-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathrun-sample.sh
More file actions
executable file
·53 lines (50 loc) · 1.6 KB
/
run-sample.sh
File metadata and controls
executable file
·53 lines (50 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -euo pipefail
echo "Spring Shell Samples"
echo "===================="
echo ""
echo "Select a sample to run:"
echo ""
echo " 1) hello-world — Simple greeting shell application"
echo " 2) non-interactive — Non-interactive sample (runs 'hi' and exits)"
echo " 3) petclinic — Spring PetClinic shell application"
echo " 4) secure-input — Secure input / password prompt sample"
echo " 5) spring-boot — Spring Boot-based shell application"
echo ""
read -rp "Enter your choice [1-5]: " choice
case "$choice" in
1)
echo ""
echo "Running: hello-world"
./mvnw -pl org.springframework.shell:spring-shell-sample-hello-world \
exec:java -Dexec.mainClass=org.springframework.shell.samples.helloworld.SpringShellApplication
;;
2)
echo ""
echo "Running: non-interactive"
./mvnw -pl org.springframework.shell:spring-shell-sample-non-interactive \
spring-boot:run -Dspring-boot.run.arguments=hi
;;
3)
echo ""
echo "Running: petclinic"
./mvnw -pl org.springframework.shell:spring-shell-sample-petclinic \
exec:java -Dexec.mainClass=org.springframework.shell.samples.petclinic.SpringShellApplication
;;
4)
echo ""
echo "Running: secure-input"
./mvnw -pl org.springframework.shell:spring-shell-sample-secure-input \
spring-boot:run
;;
5)
echo ""
echo "Running: spring-boot"
./mvnw -pl org.springframework.shell:spring-shell-sample-spring-boot \
spring-boot:run
;;
*)
echo "Invalid choice: '$choice'. Please enter a number between 1 and 5." >&2
exit 1
;;
esac