diff --git a/Jenkinsfile b/Jenkinsfile index cb9af2d..a8cdc29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -123,6 +123,12 @@ pipeline { || git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_jenkins.git git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ push --force master HEAD:refs/heads/master + git ls-remote --heads master | awk '{print $2}' | sed 's#refs/heads/##' | while read branch; do + if [ -n "$branch" ] && [ "$branch" != "master" ]; then + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push master --delete "$branch" + fi + done ''' } }