Improve: git token auth in setup.sh
parent
ef3b43ccbd
commit
65016869b7
27
setup.sh
27
setup.sh
|
|
@ -76,12 +76,29 @@ sudo -u $USER git config \
|
|||
sudo -u $USER git config \
|
||||
--global user.email "deploy@aziros.com"
|
||||
|
||||
# ═══════════════════════════════════════
|
||||
# SCHRITT 6 — Repo clonen
|
||||
# ═══════════════════════════════════════
|
||||
echo "→ Repository wird geklont..."
|
||||
REPO="https://git.nexlab.at/boban/aziros.git"
|
||||
|
||||
# ═══════════════════════════════════════
|
||||
# SCHRITT 6 — Git Token + Repo clonen
|
||||
# ═══════════════════════════════════════
|
||||
echo "→ Gitea Access Token eingeben:"
|
||||
echo " (Gitea → Einstellungen → Anwendungen → Token erstellen)"
|
||||
read -sp "Token: " GIT_TOKEN
|
||||
echo ""
|
||||
|
||||
# Credentials speichern:
|
||||
echo "https://token:$GIT_TOKEN@git.nexlab.at" > \
|
||||
/home/$USER/.git-credentials
|
||||
chmod 600 /home/$USER/.git-credentials
|
||||
chown $USER:$USER /home/$USER/.git-credentials
|
||||
|
||||
# Git credential helper setzen:
|
||||
sudo -u $USER git config \
|
||||
--global credential.helper store
|
||||
|
||||
# Repo URL mit Token:
|
||||
REPO="https://token:$GIT_TOKEN@git.nexlab.at/boban/aziros.git"
|
||||
|
||||
echo "→ Repository wird geklont..."
|
||||
if [ -d "/home/$USER/aziros" ]; then
|
||||
echo "→ Repo existiert — pull"
|
||||
sudo -u $USER git -C \
|
||||
|
|
|
|||
Loading…
Reference in New Issue