nelle-observer/build.sh

53 lines
1.4 KiB
Bash
Raw Normal View History

2024-09-15 19:51:50 -06:00
#!/bin/bash
2024-09-15 21:23:21 -06:00
# Reset
RESET='\033[0m' # Text Reset
# Regular Colors
BLACK='\033[0;30m' # Black
RED='\033[0;31m' # Red
GREEN='\033[0;32m' # Green
YELLOW='\033[0;33m' # Yellow
BLUE='\033[0;34m' # Blue
PURPLE='\033[0;35m' # Purple
CYAN='\033[0;36m' # Cyan
WHITE='\033[0;37m' # White
read -p "${CYAN}build the frontend? ${GREEN}Yes(y) ${RESET}/ No(n) ${RESET}/ Cancel(c)${RESET}:- " choice
2024-09-15 20:09:45 -06:00
if [ "$choice" = "y" ]; then
echo "building static site!"
pnpm i
pnpm run build
read -p "build the backend? Yes(y) / No(n) / Cancel(c):- " choice
if [ "$choice" = "y" ]; then
echo "building backend!"
cd backend
./gradlew shadowJar
2024-09-15 20:12:10 -06:00
systemctl restart nelle-observer-api
2024-09-15 20:09:45 -06:00
elif [ "$choice" = "n" ]; then
echo "exiting..."
elif [ "$choice" = "c" ]; then
echo "build cancelled"
else
echo "no choice given, exiting..."
fi
elif [ "$choice" = "n" ]; then
read -p "build the backend? Yes(y) / No(n) / Cancel(c):- " choice
if [ "$choice" = "y" ]; then
echo "building backend!"
cd backend
./gradlew shadowJar
2024-09-15 20:12:10 -06:00
systemctl restart nelle-observer-api
2024-09-15 20:09:45 -06:00
elif [ "$choice" = "n" ]; then
echo "exiting..."
elif [ "$choice" = "c" ]; then
echo "build cancelled"
else
echo "no choice given, exiting..."
fi
elif [ "$choice" = "c" ]; then
echo "Installation cancelled"
else
echo "No Choice given, exiting..."
fi