pipeline + ssh-agent + git authentication problem

558 views
Skip to first unread message

Ivo Houbrechts

unread,
Aug 1, 2016, 8:34:01 AM8/1/16
to Jenkins Users
Hi,

I'm running jenkins 2.16 with the ssh-agent 1.13 plugin.
I checkout a pipline script from git with global jenkins credentials. The script then tries to checkout the whole repository:

node {
    //jenkins_pk is the ID of the same credentials used to checkout this script
    sshagent
(['jenkins_pk']) {
        git url
: 'g...@bitbucket.org:houbie/simplegroovy.git'
   
}
}

The error I get is : Permission denied (publickey)
I tried this with private keys with and without passphrase.

I'm I missing something here?

Ivo Houbrechts

unread,
Aug 1, 2016, 9:43:57 AM8/1/16
to Jenkins Users
Found it myself: you can specify the credentials with the git command

        git url: 'g...@bitbucket.org:houbie/simplegroovy.git', credentialsId: 'jenkins_pk'




Op maandag 1 augustus 2016 14:34:01 UTC+2 schreef Ivo Houbrechts:
Reply all
Reply to author
Forward
0 new messages