From 0826fdfd6bf3a8f729310e903454b326d2e1de63 Mon Sep 17 00:00:00 2001 From: Olivier Revial Date: Mon, 17 Jul 2017 10:46:35 +0200 Subject: [PATCH] Add ssh-agent usage example Just added a small example of ssh-agent usage for Git push --- pipeline-examples/push-git-repo/pushGitRepo.Groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pipeline-examples/push-git-repo/pushGitRepo.Groovy b/pipeline-examples/push-git-repo/pushGitRepo.Groovy index 597ec63..37ba143 100644 --- a/pipeline-examples/push-git-repo/pushGitRepo.Groovy +++ b/pipeline-examples/push-git-repo/pushGitRepo.Groovy @@ -11,3 +11,7 @@ withCredentials([usernamePassword(credentialsId: 'MyID', passwordVariable: 'GIT_ } // For SSH private key authentication, try the sshagent step from the SSH Agent plugin. +sshagent (credentials: ['git-credentials']) { + sh("git tag -a some_tag -m 'Jenkins'") + sh('git push --tags') +}