From 190c397809fe0af09df5d9b334d5c44c5d993f3c Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Thu, 16 Apr 2026 17:47:59 +0200 Subject: [PATCH] OP#581 add tagging sync --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a8cdc29..a5f7206 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,7 +114,7 @@ pipeline { passwordVariable: 'GITEA_TOKEN')]) { script { sh ''' - git fetch origin + git fetch --tags origin git checkout -B gitea-mirror-$BUILD_NUMBER origin/master git rm -f Jenkinsfile git commit -m "Remove Jenkinsfile for Gitea mirror" || echo "No changes to commit" @@ -129,6 +129,14 @@ pipeline { push master --delete "$branch" fi done + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push master --tags + git ls-remote --tags master | awk '{print $2}' | sed -e 's#refs/tags/##' -e 's/\^{}$//' | sort -u | while read tag; do + if [ -n "$tag" ] && ! git show-ref --tags --verify --quiet "refs/tags/$tag"; then + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push master ":refs/tags/$tag" + fi + done ''' } }