Compare commits
2 commits
cade08b7ac
...
227f5f7a32
Author | SHA1 | Date | |
---|---|---|---|
227f5f7a32 | |||
131869e61b |
1 changed files with 36 additions and 14 deletions
50
build.sh
50
build.sh
|
@ -1,38 +1,60 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
read -p "build the frontend? Yes(y) / No(n) / Cancel(c):- " choice
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
BACKEND_Q="${CYAN}build the backend? ${GREEN}Yes(y) ${RESET}/ ${RED}No(n) ${RESET}/ ${YELLOW}Cancel(c)${RESET}:- "
|
||||||
|
FRONTEND_Q="${CYAN}build the frontend? ${GREEN}Yes(y) ${RESET}/ ${RED}No(n) ${RESET}/ ${YELLOW}Cancel(c)${RESET}:- "
|
||||||
|
EXITING="${RED}exiting...${RESET}"
|
||||||
|
NO_CHOICE="${RED}no choice given, exiting...${RESET}"
|
||||||
|
BUILD_CANCELLED="${YELLOW}canelling build...${RESET}"
|
||||||
|
BUILDING_BACK="${PURPLE}building backend!${RESET}"
|
||||||
|
BUILDING_FRONT="${PURPLE}building static site!${RESET}"
|
||||||
|
|
||||||
|
read -p "$(echo -e ${FRONTEND_Q})" choice
|
||||||
if [ "$choice" = "y" ]; then
|
if [ "$choice" = "y" ]; then
|
||||||
echo "building static site!"
|
echo -e "${BUILDING_FRONT}"
|
||||||
pnpm i
|
pnpm i
|
||||||
pnpm run build
|
pnpm run build
|
||||||
read -p "build the backend? Yes(y) / No(n) / Cancel(c):- " choice
|
read -p "$(echo -e ${BACKEND_Q})" choice
|
||||||
if [ "$choice" = "y" ]; then
|
if [ "$choice" = "y" ]; then
|
||||||
echo "building backend!"
|
echo -e "${BUILDING_BACK}"
|
||||||
cd backend
|
cd backend
|
||||||
./gradlew shadowJar
|
./gradlew shadowJar
|
||||||
systemctl restart nelle-observer-api
|
systemctl restart nelle-observer-api
|
||||||
elif [ "$choice" = "n" ]; then
|
elif [ "$choice" = "n" ]; then
|
||||||
echo "exiting..."
|
echo -e "${EXITING}"
|
||||||
elif [ "$choice" = "c" ]; then
|
elif [ "$choice" = "c" ]; then
|
||||||
echo "build cancelled"
|
echo -e "${BUILD_CANCELLED}"
|
||||||
else
|
else
|
||||||
echo "no choice given, exiting..."
|
echo -e "${NO_CHOICE}"
|
||||||
fi
|
fi
|
||||||
elif [ "$choice" = "n" ]; then
|
elif [ "$choice" = "n" ]; then
|
||||||
read -p "build the backend? Yes(y) / No(n) / Cancel(c):- " choice
|
read -p "$(echo -e ${BACKEND_Q})" choice
|
||||||
if [ "$choice" = "y" ]; then
|
if [ "$choice" = "y" ]; then
|
||||||
echo "building backend!"
|
echo -e "${BUILDING_BACK}}"
|
||||||
cd backend
|
cd backend
|
||||||
./gradlew shadowJar
|
./gradlew shadowJar
|
||||||
systemctl restart nelle-observer-api
|
systemctl restart nelle-observer-api
|
||||||
elif [ "$choice" = "n" ]; then
|
elif [ "$choice" = "n" ]; then
|
||||||
echo "exiting..."
|
echo -e "${EXITING}"
|
||||||
elif [ "$choice" = "c" ]; then
|
elif [ "$choice" = "c" ]; then
|
||||||
echo "build cancelled"
|
echo -e "${BUILD_CANCELLED}"
|
||||||
else
|
else
|
||||||
echo "no choice given, exiting..."
|
echo -e "${NO_CHOICE}"
|
||||||
fi
|
fi
|
||||||
elif [ "$choice" = "c" ]; then
|
elif [ "$choice" = "c" ]; then
|
||||||
echo "Installation cancelled"
|
echo -e "${BUILD_CANCELLED}"
|
||||||
else
|
else
|
||||||
echo "No Choice given, exiting..."
|
echo -e "${NO_CHOICE}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue