Working docker-compose
This commit is contained in:
@@ -3,7 +3,8 @@ set -e
|
||||
|
||||
WORKPTH="/etc/debmirror/"
|
||||
REPO_DIR="$WORKPTH/Debain-repos"
|
||||
REPO_URL="https://$GITEA_TOKEN@tea.shupogaki.org/YuruC3/Debain-repos.git"
|
||||
REPO_URL="https://tea.shupogaki.org/YuruC3/Debain-repos.git"
|
||||
|
||||
|
||||
# Clone repo only if it doesn't already exist
|
||||
if [ ! -d "$REPO_DIR/.git" ]; then
|
||||
@@ -14,6 +15,7 @@ fi
|
||||
|
||||
cd "$REPO_DIR"
|
||||
|
||||
git remote set-url origin "https://${GITEA_TOKEN}@tea.shupogaki.org/YuruC3/Debain-repos.git"
|
||||
|
||||
git config user.name "UpdateBot"
|
||||
git config user.email "UpdateBot@localhost.local"
|
||||
@@ -21,14 +23,15 @@ git config user.email "UpdateBot@localhost.local"
|
||||
# pull changes
|
||||
git pull
|
||||
|
||||
# check if modified
|
||||
if git diff --quiet && git diff --cached --quiet; then
|
||||
echo "No changes to commit."
|
||||
# if yes, push
|
||||
# stage files
|
||||
git add MirrorListV4 MirrorListV6
|
||||
|
||||
# Commit and push only if there's anything new staged
|
||||
if git diff --cached --quiet; then
|
||||
echo "[$(date)] No changes to commit."
|
||||
else
|
||||
git add MirrorsV4 MirrorsV6
|
||||
git commit -m "Auto-update mirror list on $(date -Iseconds)"
|
||||
git push
|
||||
echo "Changes pushed successfully."
|
||||
echo "[$(date)] Changes pushed successfully."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user