Jenkins:tfs repo没有触发Jenkins构建,但为什么呢?

时间:2017-03-19 15:59:38

标签: jenkins tfs

我已经配置了一个监控TFS git存储库的Jenkins作业,并且应该在代码被更改(推送)时触发构建。

我为配置解决方案所做的工作:

  • 我在TFS存储库上为Jenkins创建了一个服务挂钩。

  • 我在Jenkins上安装了Team Foundation Server插件和VS Team Services持续部署,并按如下方式配置了这些作业:

在“源代码管理”下 我选择了Team Foundation Version Control(TFVC)并对其进行了如下配置:

Collection URL: https://company.visualstudio.com/defaultcollection
Project path: $/Wilhelm/_git/NWilhelm
Credentials: Automatic (I've also tried with Manual creds and got the same result)

然后,在“管理Jenkins - >配置系统”中,在TFS / Team Services下,我已配置:

Collection URL: https://company.visualstudio.com    
Credentials: Selected the correct user which has access to the repo
Enable Push Trigger for all jobs: checked

然后点击保存。

这些是我做过的测试:

我手动运行构建:

Started by user Itai
Building remotely on jenkins-windows-slave (windows-slave) in workspace c:\jenkins\workspace\iis-deploy-new
Querying for remote changeset at '$/Wilhelm/_git/NWilhelm' as of 'D2017-03-19T15:39:58Z'...
Query returned no result!
FATAL: null
java.lang.NullPointerException
    at hudson.plugins.tfs.model.Project.extractChangesetNumber(Project.java:276)
    at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:271)
    at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:287)
    at hudson.plugins.tfs.TeamFoundationServerScm.recordWorkspaceChangesetVersion(TeamFoundationServerScm.java:359)
    at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:308)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1728)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE

这是我在Jenkins工作时遇到的错误。

  • 我已经推动对回购的改变,希望它能触发Jenkins的构建,但什么都没发生。

  • 我已经检查了作业上的TFS webhook日志,但它是空的。

知道我做错了吗?

1 个答案:

答案 0 :(得分:1)

"团队基础版本控制(TFVC)"当您使用Git版本控制系统时,选项用于从TFVC版本控制系统获取文件。请选择" Git" "源代码管理"然后再试一次。