From 05f00630c7c1c0bc832800199ff6f2a65b6b8444 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 19 Jun 2018 21:49:12 +0100 Subject: [PATCH] crowdin: Use separate keys for pushing to znc and znc-jenkins --- .ci/Jenkinsfile.crowdin | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.ci/Jenkinsfile.crowdin b/.ci/Jenkinsfile.crowdin index 4c89a5f6..2cd50058 100644 --- a/.ci/Jenkinsfile.crowdin +++ b/.ci/Jenkinsfile.crowdin @@ -69,14 +69,20 @@ timestamps { } 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}" + } + } + 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']) { - if (!pr_mode) { - sh "git push upstream HEAD:refs/heads/${upstream_branch}" - return - } sh "git push my HEAD:refs/heads/${my_branch} -f" } }