Examples: 

git push '****:****@https://github.****.git/ 
<https://github.ibm.com/security-services/certificate-management-utils.git/>'


But it says: fatal: I don't handle protocol '****:****@https'

Then also tried:

git remote set-url origin https://****:****@github.****.git 
<https://****:****@github.ibm.com:security-services/certificate-management-utils.git>
git push origin master


But it fails with:
fatal: unable to access 'https://****:****@github.****.com:****.git/ 
<https://****:****@github.ibm.com:security-services/certificate-management-utils.git/>':
 
Could not resolve host: ****:****@github.****.com; Name or service not known

With sshagent:

git remote set-url origin git@github.****.com:****.git
+ git push origin master
Host key verification failed.
fatal: Could not read from remote repository.


On Friday, March 24, 2017 at 2:44:58 PM UTC+3, Idan Adar wrote:
>
> Note: this is done in a declarative pipeline.
>
> jglick, thoughts?
>
> On Friday, March 24, 2017 at 2:37:57 PM UTC+3, Idan Adar wrote:
>>
>> How do you get "git push" to work in a Jenkinsfile? I am not sure what am 
>> I missing.
>>
>> The Jenkinsfile checkouts a repo using an access token (this is 
>> configured in the Jenkins UI for the job).
>> The Jenkins file also does a merge of a PR in one of its stages: 
>>
>> withCredentials([usernamePassword(credentialsId: '****', usernameVariable
>> : 'ACCESS_TOKEN_USERNAME', passwordVariable: 'ACCESS_TOKEN_PASSWORD',)]) 
>> {
>>     sh "curl -X PUT -d '{\"commit_title\": \"Merge pull request\"}' 
>>  https://***/pulls/$CHANGE_ID/merge?access_token=$ACCESS_TOKEN_PASSWORD";
>> }
>>
>> But I can't get "git push" to work in another stage:
>>
>> git config --global user.name '****'
>> git config --global user.email ****
>> git commit -am 'Bumped version number'
>> git remote set-url origin git@****.git
>> git push origin master
>>
>> I tried wrapping the above in withCredential and also . with agent, but 
>> nothing works...  
>>
>> Tips?
>>
>

-- 
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/16980860-a0fc-42d0-b091-eb5f607001fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to