Jenkins中的一些问题解决(~~不断更新~~)

请使用ctrl+F,查询页面中你需要查找的错误信息(注意空格的输入)

1.错误“error fetching remote repo origin”

本地有多个sshkey,导致构建时 提示


Started by user anonymous
Building in workspace C:\Users\dell\.jenkins\workspace\pythons
git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git.exe config remote.origin.url git@xxxxxxxx.git # timeout=10
Fetching upstream changes from git@xxxxxx.git
git.exe --version # timeout=10
git.exe -c core.askpass=true fetch --tags --progress git@xxxxxxx.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

解决方法

1、先将源码管理职位none,点击构建,构建无问题

2、在构建输入 git clone 仓库地址,在进行构建,此次构建失败,提示无权限

3、在命令行输入 :

set home=c:\users\dell
git clone git@xxxx.git

此次构建成功

4、设置set home原因jenkins在 windows 下安装会依赖宿主,故如此设置

5、在系统设置-全局属性中,增加键 -值

6、若仍然报错

看错误之前是“> git.exe config --local --remove-section credential # timeout=10”,不会是跟密码有关吧!

将url改成http://用户名:密码@ip/的格式,git配置改成不使用密码,结果OK了。

其他办法:

http://stackoverflow.com/questions/38391601/jenkins-error-error-fetching-remote-repo-origin

https://issues.jenkins-ci.org/browse/JENKINS-26757

 

2.如何解决xmlrunner问题:

下载对应的文件:https://pypi.python.org/simple/unittest-xml-reporting/ 找到对应版本

下载后,到文件所在路径下,dos窗口执行https://pypi.python.org/simple/unittest-xml-reporting/

会提示

则xmlrunner 安装成功

需要在此处添加该步骤即可(脚本里添加这样一行

import xmlrunner
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports')))

点击应用保存,进行构建,则可以看到如图所示内容(刚配置完后,执行第二次构建后就可以看到了)

最后的执行结果

 

 
posted @ 2017-07-25 12:13  碎冰  阅读(7797)  评论(0编辑  收藏  举报