fix: unused file
This commit is contained in:
1 parent
d12d7e237f
commit
c0920febca
1 file changed
-72
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
RED="\e[31m"
|
||||
GREEN="\e[32m"
|
||||
YELLOW="\e[33m"
|
||||
BLUE="\e[34m"
|
||||
MAGENTA="\e[35m"
|
||||
CYAN="\e[36m"
|
||||
GRAY="\e[90m"
|
||||
BOLD="\e[1m"
|
||||
DIM="\e[2m"
|
||||
UNDERLINE="\e[4m"
|
||||
RESET="\e[0m"
|
||||
|
||||
current_user=$(whoami)
|
||||
timestamp=$(date +"%Y:%m:%d:%H:%M")
|
||||
hostname=$(hostname)
|
||||
backendrepository="http://gitea.blackpi.ipv64.net/bruno/Backend.git"
|
||||
publicrepository="http://gitea.blackpi.ipv64.net/bruno/Web-Public.git"
|
||||
directory="/data/WEBSERVER"
|
||||
|
||||
if [ "$current_user" != "root" ]; then
|
||||
echo -e "${RED}Das Script wird nicht als root-Benutzer ausgeführt!!!${RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 {all|public|backend}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ACTION=$1
|
||||
|
||||
case "$ACTION" in
|
||||
all)
|
||||
echo "Deploying everything..."
|
||||
# Hier dein Code für 'deploy all'
|
||||
;;
|
||||
public)
|
||||
echo -e "${GREEN}${BOLD}Deploying public part...${RESET}"
|
||||
echo -e "${YELLOW}Verschiebe verzeichnis ins Public${RESET}"
|
||||
mv $directory/PUBLIC $directory/BACKUP/
|
||||
echo -e "${YELLOW}Ändere den verzeichnis namen${RESET}"
|
||||
mv $directory/BACKUP/PUBLIC $directory/BACKUP/PUBLIC-$timestamp-$hostname
|
||||
echo -e "${YELLOW}Erstelle neues PUBLIC verzeichnis${RESET}"
|
||||
mkdir $directory/PUBLIC
|
||||
echo -e "${GREEN}Clone Repository${RESET}"
|
||||
git clone $publicrepository $directory/PUBLIC
|
||||
echo -e "${GREEN}Start container neu${RESET}"
|
||||
docker restart WEBSERVER-PUBLIC
|
||||
;;
|
||||
backend)
|
||||
echo -e "${GREEN}${BOLD}Deploying backend part...${RESET}"
|
||||
echo -e "${YELLOW}Verschiebe verzeichnis ins Backup${RESET}"
|
||||
mv $directory/BACKEND $directory/BACKUP/
|
||||
echo -e "${YELLOW}Ändere den verzeichnis namen${RESET}"
|
||||
mv $directory/BACKUP/BACKEND $directory/BACKUP/BACKEND-$timestamp-$hostname
|
||||
echo -e "${YELLOW}Erstelle neues Backend verzeichnis${RESET}"
|
||||
mkdir $directory/BACKEND
|
||||
echo -e "${GREEN}Clone Repository${RESET}"
|
||||
git clone $backendrepository $directory/BACKEND
|
||||
echo -e "${GREEN}Start container neu${RESET}"
|
||||
docker restart WEBSERVER-BACKEND
|
||||
;;
|
||||
*)
|
||||
echo "Unknown action: $ACTION"
|
||||
echo "Usage: $0 {all|public}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user