diff --git a/.vscode/settings.json b/.vscode/settings.json index c808a20..52e6580 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "changeme", + "GITEA", "GOMAXPROCS", "procs", "reqpackage", diff --git a/Jenkinsfile b/Jenkinsfile index 9de032c..88fa7e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -101,5 +101,27 @@ pipeline { } } } + + stage('Mirror to Gitea') { + steps { + withCredentials([usernamePassword( + credentialsId: 'Jenkins-gitea', + usernameVariable: 'GITEA_USER', + passwordVariable: 'GITEA_TOKEN')]) { + script { + // Checkout from GitLab (already done implicitly) + sh ''' + git checkout master + git pull origin master + git branch -D development + git branch -D jenkins-build-$BUILD_NUMBER + git remote add master https://gitea.confdroid.com/confdroid/prometheus_cd.git + git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ + push master --mirror + ''' + } + } + } + } } } \ No newline at end of file