Crowdin Jenkins: Use sshagent instead of a hack - attempt 2

This commit is contained in:
Alexey Sokolov
2019-07-15 21:11:05 +01:00
parent eb904c4545
commit 4222c3e533
+4 -13
View File
@@ -68,23 +68,14 @@ timestamps {
return
}
sh "git remote add my github.com:${my_user}/${my_repo}.git"
// TODO simplify when https://issues.jenkins-ci.org/browse/JENKINS-28335 is fixed
if (!pr_mode) {
withCredentials([sshUserPrivateKey(credentialsId: 'baf2df74-935d-40e5-b20f-076e92fa3e9f', keyFileVariable: 'GITHUB_KEY')]) {
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh'
sh 'chmod +x run_ssh.sh'
withEnv(['GIT_SSH=run_ssh.sh']) {
sh "git push upstream HEAD:refs/heads/${upstream_branch}"
}
sshagent(credentials: ['baf2df74-935d-40e5-b20f-076e92fa3e9f']) {
sh "git push upstream HEAD:refs/heads/${upstream_branch}"
}
return
}
withCredentials([sshUserPrivateKey(credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', keyFileVariable: 'GITHUB_KEY')]) {
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh'
sh 'chmod +x run_ssh.sh'
withEnv(['GIT_SSH=run_ssh.sh']) {
sh "git push my HEAD:refs/heads/${my_branch} -f"
}
sshagent(credentials: ['6ef10f80-20dc-4661-af45-52a6e1e15749']) {
sh "git push my HEAD:refs/heads/${my_branch} -f"
}
// Create pull request if it doesn't exist yet
withCredentials([string(credentialsId: '7a2546ae-8a29-4eab-921c-6a4803456dce', variable: 'GITHUB_OAUTH_KEY')]) {