OP#581 add tagging sync

This commit is contained in:
2026-04-16 17:47:59 +02:00
parent 1707d16d5e
commit 190c397809

10
Jenkinsfile vendored
View File

@@ -114,7 +114,7 @@ pipeline {
passwordVariable: 'GITEA_TOKEN')]) { passwordVariable: 'GITEA_TOKEN')]) {
script { script {
sh ''' sh '''
git fetch origin git fetch --tags origin
git checkout -B gitea-mirror-$BUILD_NUMBER origin/master git checkout -B gitea-mirror-$BUILD_NUMBER origin/master
git rm -f Jenkinsfile git rm -f Jenkinsfile
git commit -m "Remove Jenkinsfile for Gitea mirror" || echo "No changes to commit" git commit -m "Remove Jenkinsfile for Gitea mirror" || echo "No changes to commit"
@@ -129,6 +129,14 @@ pipeline {
push master --delete "$branch" push master --delete "$branch"
fi fi
done 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
''' '''
} }
} }