Skip to content

Commit

Permalink
Add ssh-agent usage example
Browse files Browse the repository at this point in the history
Just added a small example of ssh-agent usage for Git push
  • Loading branch information
Olivier Revial authored Jul 17, 2017
1 parent d4440da commit 0826fdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pipeline-examples/push-git-repo/pushGitRepo.Groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 <REPO> --tags')
}

0 comments on commit 0826fdf

Please sign in to comment.