Jenkins的工作挂在"git push origin branch"上.由于认证 [英] Jenkins job hangs on "git push origin branch" due to authentification

查看:221
本文介绍了Jenkins的工作挂在"git push origin branch"上.由于认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在jenkins job shell命令中执行以下操作:

I try to do the folowing in jenkins job shell command:

签出开发分支,进行一些更改,然后提交并推送到原始分支,如下所示:

checked out develop branch, did some changes, committed and pushed to origin branch as follow:

1. check out the develop branch:
git remote add origin http://name@url/project
git checkout develop
2. make some changes
3. commit changes
git commit -a -m "committed"
4. push to origin 
git push origin develop

詹金斯(Jenkins)的工作挂在了最后一步.看截图

jenkins job hung up on the last step. see the screenshot

我做错了什么?

推荐答案

从您提供的git URL中,我看到您未使用SSH URL,而当您尝试推送它时,可能需要输入密码.我会尝试跟随

From the git URL you provided I see your not using SSH URL, when your trying to push it is probably expecting the password. I would trying following

  1. 尝试登录Jenkins后从终端执行相同的步骤 服务器,看看是否遇到相同的错误
  2. 在jenkins作业中配置您的密码,并在如下所示的shell脚本中使用它

  1. Try to do same steps from terminal after logging into Jenkins server, see whether you face same error
  2. Configure your password in jenkins job and use it part of your shell script like below

expect -c'spawn sudo git push起源开发;期望-ex {assword:};发送-'$ password'\ n;期待eof退出'

expect -c 'spawn sudo git push origin develop; expect -ex {assword:}; send -- '$password'\n; expect eof exit'

这篇关于Jenkins的工作挂在"git push origin branch"上.由于认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆