jenkins: push ftp repo to community mirror on releases
@@ -464,6 +464,16 @@ def publishSource(artifactStageName) {
sh 'cp ../release-artifact/*/*.tar.gz* ./releases/'
sh "git commit -a -m 'release: add ${RELEASE_VERSION}'"
pushGitRepo('ftp')
+ withCredentials([sshUserPrivateKey(credentialsId: "community-ssh-git", keyFileVariable: "privateSshKey", usernameVariable: 'GIT_USERNAME')]) {
+ // add community server to known hosts
+ sh "mkdir -p ~/.ssh/ && ssh-keyscan -t rsa doc.libelektra.org >> ~/.ssh/known_hosts"
+ // add community mirror of ftp repo as remote
+ sh "git remote add community ${GIT_USERNAME}@doc.libelektra.org:/srv/elektra"
+ }
+ // push to community mirror
+ sshagent(['community-ssh-git']) {
+ sh "git push community master"
+ }
}
}
}
