https://jenkins.io/doc/pipeline/examples/#push-git-repo gives an example of 
both https and ssh

On Saturday, March 23, 2019 at 11:20:27 AM UTC-6, Rade Milijasevic wrote:
>
> Can somebody please give an example code for both https:// url and ssh 
> approach.
> thanks 
>
> On Fri, Mar 22, 2019 at 5:11 PM Robert Nicholson  wrote:
>
>> I haven’t tried any ssh: url based approach yet.
>>
>> but the approaches I’ve seen are when you use GIT_SSH etc to inject your 
>> own private key into the ssh that was
>> extracted using withCredentials and written to a tmp folder on disk 
>> temporarily but I see no indication that it’s
>> ever using this key.
>>
>> On Mar 22, 2019, at 12:13 PM, Ivan Fernandez Calvo  wrote:
>>
>> for the https case, there is an example at 
>> https://jenkins.io/doc/pipeline/examples/#push-git-repo
>>
>> El viernes, 22 de marzo de 2019, 15:00:47 (UTC+1), Robert Nicholson 
>> escribió:
>>>
>>> Ok it’s a https: url
>>>
>>> So how do you construct the appropriate 
>>>
>>> ssh command then?
>>>
>>> all examples that use withCredentials seems to fail on my side.
>>>
>>>
>>>
>>> On Mar 21, 2019, at 1:55 PM, Mark Waite <mark.ea...@gmail.com> wrote:
>>>
>>> Is the repository URL an ssh URL?  If not, then sshagent won't help.  
>>> The ssh agent does not do http or https
>>>
>>> On Thu, Mar 21, 2019 at 12:51 PM Robert Nicholson <robert.n...@gmail.com> 
>>> wrote:
>>>
>>>> I am able to tag the code locally but the push with credentials key 
>>>> based seems to be an issue.
>>>>
>>>> sshagent([‘credentialsKey]) {
>>>>    sh “git push origin master —tags”
>>>> }
>>>>
>>>> this step errors with
>>>>
>>>> fatal: could not read Username for ‘repository hostname’ : No such 
>>>> device or address
>>>>
>>>> Prior in my pipeline I have a repository defined using 
>>>>
>>>> Pipeline script from SCM where the url is defined with https://……..git 
>>>> <https://��..git>
>>>>
>>>> What is the recommended approach to push when using primary/public key 
>>>> with git from JenkinsFile pipeline?
>>>>
>>>> -- 
>>>> 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 jenkinsci-use...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-users/D357517D-5BB0-4A3B-9409-F025C01D470B%40gmail.com
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> -- 
>>> Thanks!
>>> Mark Waite
>>>
>>> -- 
>>> 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 jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGBhRbuWRLrbxuDUZJpORVyikyGff8B5nFCE62c2L9Zjg%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGBhRbuWRLrbxuDUZJpORVyikyGff8B5nFCE62c2L9Zjg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>> -- 
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/fdeaee54-5b99-4e05-a1e6-e02b91e9c0b3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/fdeaee54-5b99-4e05-a1e6-e02b91e9c0b3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/24140516-67D1-4F51-A525-539C447319A2%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/24140516-67D1-4F51-A525-539C447319A2%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e67b67c5-e7e8-453e-b4f5-aaa3ddca92f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to