diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 89b1287..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cSpell.words": [ - "descr", - "dport", - "fontconfig", - "gpgcheck", - "NOPASSWD", - "repodata", - "repomd", - "requiretty", - "yumrepo" - ] -} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 9f2822d..a8cdc29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,6 +96,7 @@ pipeline { sh ''' git config user.name "Jenkins Server" git config user.email jenkins@confdroid.com + git rm -r --cached .vscode || echo "No .vscode to remove from git" git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit" git fetch origin git checkout -B master origin/master @@ -114,13 +115,20 @@ 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 + 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 ''' } }