Hi Salaran,
*have you resolved this issue ?, I'm getting the same issue like wise any
help :)*
On Tuesday, May 23, 2017 at 4:24:19 PM UTC+5:30, Aitkiar Salaran wrote:
>
> Hi,
>
> I have pipeline job that uses ssh agent step to set up credentials to
> connect to git repository and clone it. When i execute the job on the
> master jenkins, it runs flawlesly. When run it on a slave it fails because
> ssh agent closes before the git clone.
>
> This is an example of the code that produces the error:
>
> node
> {
> def credentials = 'somecredentials'
> sshagent (credentials: [credentials])
> {
> sh ( script:"""
> rm -rf common_jenkins_jobs
> git clone ssh://[email protected]
> """)
> }
> }
>
> node ( "ci-server-slave" )
> {
> def credentials = 'somecredentials'
> sshagent (credentials: [credentials])
> {
> sh ( script:"""
> rm -rf common_jenkins_jobs
> git clone ssh://[email protected]
> """)
> }
> }
>
> The first block runs on the master node and the seccond on the slave.
> Examing the execution logs of the first block you can see the sequence:
>
> 1. ssh-agent start
> 2. rm
> 3. git
> 4. ssh-agent stop
>
> but the part that runs on the slave shows the sequence:
>
> 1. ssh-agent start
> 2. ssh-agent stop
> 3. rm
> 4. git
>
> leaving the git clone out of the ssh-agent environment and failing due to
> lack of crecedentials.
>
>
> I attached the log of the second node on a simpler test where the sh step
> only runs an ls ltr command. There you can clearly see that the ls command
> runs after the ssh-agent ends.
>
>
> ¿ Can this behaviour be part of some missconfiguration on my part or is a
> bug on the ssh agent step ?
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/2149bddb-aa85-4a1f-b314-bf2923fb9550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.