Files

47 lines
1.2 KiB
Bash

#!/bin/bash
set -Eeuo pipefail
########################################
# Farben
########################################
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
BOLD="\e[1m"
RESET="\e[0m"
########################################
# Logging
########################################
log_info() { echo -e "${BLUE}[INFO]${RESET} $1"; }
log_success() { echo -e "${GREEN}[OK]${RESET} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${RESET} $1"; }
log_error() { echo -e "${RED}[ERROR]${RESET} $1"; }
BASE_DIR="$(pwd)/WEBSERVER/"
TIMESTAMP=$(date +"%Y%m%d-%H%M%S")
HOSTNAME=$(hostname)
PUBLIC_REPO="https://gitea.mrhossa.de/bruno/Web-Public.git"
BACKEND_REPO="https://gitea.mrhossa.de/bruno/Backend.git"
if [[ "$EUID" -ne 0 ]]; then
log_error "Script muss als root laufen!"
exit 1
fi
read -p "Git Username: " GIT_USERNAME
read -p "Git Email: " GIT_EMAIL
git config --global credential.helper store
git config --global user.name "$GIT_USERNAME"
git config --global user.email "$GIT_EMAIL"
git clone https://gitea.mrhossa.de/bruno/Backend.git $BASE_DIR/BACKEND
git -C $BASE_DIR/BACKEND checkout dev
git clone https://gitea.mrhossa.de/bruno/Web-Public.git $BASE_DIR/PUBLIC
docker compose -f docker-compose.yml up -d --build