summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordd <dd@wx.tnyzeq.icu>2024-08-24 20:06:25 +0200
committerdd <dd@wx.tnyzeq.icu>2024-08-24 20:06:25 +0200
commit5496b2afeb97fca8350426fd83c4c7d060662556 (patch)
tree49275b831aebc4a839a673dd63e631d0f219146f
parent42b3735e2f1f685dda18352e09a24db4b0b4bc15 (diff)
downloadvyos-jenkins-5496b2afeb97fca8350426fd83c4c7d060662556.tar.gz
vyos-jenkins-5496b2afeb97fca8350426fd83c4c7d060662556.zip
improved reprepro-mirror.sh
-rwxr-xr-xextras/mirror/reprepro-mirror.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/extras/mirror/reprepro-mirror.sh b/extras/mirror/reprepro-mirror.sh
index 7f761de..df99cc2 100755
--- a/extras/mirror/reprepro-mirror.sh
+++ b/extras/mirror/reprepro-mirror.sh
@@ -21,11 +21,14 @@ set -e
# export TARGET_PATH=mirror@10.0.0.127:/var/www/...
# export JENKINS_USER="YOUR_USERNAME"
# export JENKINS_TOKEN="API_TOKEN"
+# export SYNC_COMMAND='rsync -azv --progress --delete "$sourcePath" "$targetPath"'
#
-sourcePath="/home/sentrium/web/dev.packages.vyos.net/public_html/repositories"
+sourcePath="/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/"
targetPath="/tmp/repositories/"
targetPath=${TARGET_PATH:-$targetPath}
+syncCommand='rsync -azv --progress --delete "$sourcePath" "$targetPath"'
+syncCommand=${SYNC_COMMAND:-$syncCommand}
# Jenkins configuration.
jenkinsHost="172.17.17.17:8080"
@@ -41,7 +44,7 @@ markerFiles=(
)
# Metadata.
-workDir="/tmp/reprepro-mirror"
+workDir="/var/cache/reprepro-mirror"
lastSyncPath="$workDir/lastSync"
lockPath="$workDir/lock"
@@ -114,7 +117,8 @@ if ! isSynchronizationPostponed; then
exit 0
fi
-# The synchronization command.
-rsync -azv --progress --delete "$sourcePath" "$targetPath"
+# Synchronize!
+eval "$SYNC_COMMAND"
touch "$lastSyncPath"
+echo "Done."