diff --git a/Jenkinsfile b/Jenkinsfile index aa89154..cb9af2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,13 +115,14 @@ pipeline { script { sh ''' git fetch origin - git checkout master - git reset --hard origin/master + 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" git remote get-url master >/dev/null 2>&1 \ && git remote set-url master https://sourcecode.confdroid.com/confdroid/confdroid_jenkins.git \ || 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 refs/heads/master:refs/heads/master + push --force master HEAD:refs/heads/master ''' } }