Docker succesfully pushes changed files to
other repository.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
WORKPTH="/etc/debmirror/"
|
||||
REPO_DIR="$WORKPTH/Debain-repos"
|
||||
REPO_DIR="$WORKPTH/Repo-IP-lists"
|
||||
REPO_URL="${GITURLPROTO}://${GITURL}/${GITREPOPATH}"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ git config user.name "UpdateBot"
|
||||
git config user.email "UpdateBot@localhost.local"
|
||||
|
||||
# If anything to commit locally, commit it now
|
||||
if ! git diff --cached --quiet; then
|
||||
if ! git diff --quiet; then
|
||||
echo "[$(date)] Committing local changes before pulling"
|
||||
git commit -m "Auto-commit before pull on $(date -Iseconds)"
|
||||
fi
|
||||
@@ -33,11 +33,11 @@ git pull --rebase --autostash
|
||||
git add MirrorListV4 MirrorListV6
|
||||
|
||||
# Commit and push only if there's anything new staged
|
||||
if git diff --cached --quiet; then
|
||||
if git diff --quiet; then
|
||||
echo "[$(date)] No changes to commit."
|
||||
else
|
||||
git commit -m "Auto-update mirror list on $(date -Iseconds)"
|
||||
git push
|
||||
git commit -a -m "Auto-update mirror list on $(date -Iseconds)" --quiet
|
||||
git push --quiet
|
||||
echo "[$(date)] Changes pushed successfully."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user