VSTS使用服务挂钩与Jenkins集成时遇到问题

时间:2017-06-21 08:15:04

标签: jenkins jenkins-plugins azure-pipelines azure-devops-rest-api

[作为CI的一部分,我想使用Service Hooks将VSTS与Jenkins集成,以下是我执行的步骤。

1.选择Jenkins服务选项后,我按照下面的图像输入Jenkins详细信息。

2.输入了.Jenkins基本URL,用户名,用户API令牌,但Build Textbox不允许我输入任何值。

使用构建和发布构建错误日志: -

2017-06-23T12:46:02.5702001Z ##[section]Starting: Build
2017-06-23T12:46:02.5721999Z Current agent version: '2.119.1'
2017-06-23T12:46:03.0032004Z ##[section]Starting: Initialize Job
2017-06-23T12:46:03.0122005Z Prepare build directory.
2017-06-23T12:46:03.0431992Z Set build variables.
2017-06-23T12:46:03.0471996Z Download all required tasks.
2017-06-23T12:46:03.0601994Z Downloading task: JenkinsQueueJob
2017-06-23T12:46:03.7031992Z Downloading task: JenkinsDownloadArtifacts
2017-06-23T12:46:05.7861997Z Downloading task: PublishTestResults
2017-06-23T12:46:05.9391998Z Downloading task: PublishBuildArtifacts
2017-06-23T12:46:06.1041998Z ##[section]Finishing: Initialize Job
2017-06-23T12:46:06.1351993Z ##[section]Starting: Get Sources
2017-06-23T12:46:06.1711981Z Syncing repository: MyFirstProject (TfsGit)
2017-06-23T12:46:06.1761997Z Prepending Path environment variable with directory containing 'git.exe'.
2017-06-23T12:46:06.1842000Z ##[command]git version
2017-06-23T12:46:06.4442001Z git version 2.12.0.windows.1
2017-06-23T12:46:06.4561989Z ##[command]git init "d:\a\1\s"
2017-06-23T12:46:06.5122094Z Initialized empty Git repository in d:/a/1/s/.git/
2017-06-23T12:46:06.5151998Z ##[command]git remote add origin https://ramandogra.visualstudio.com/_git/MyFirstProject
2017-06-23T12:46:06.5371993Z ##[command]git config gc.auto 0
2017-06-23T12:46:06.5571999Z ##[command]git config --get-all http.https://ramandogra.visualstudio.com/_git/MyFirstProject.extraheader
2017-06-23T12:46:06.5761994Z ##[command]git config --get-all http.proxy
2017-06-23T12:46:06.6061997Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin
2017-06-23T12:46:07.4221999Z ##[command]git checkout --progress --force refs/remotes/origin/master
2017-06-23T12:46:07.4431999Z error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git.
2017-06-23T12:46:07.6841986Z ##[error]Git checkout failed with exit code: 1
2017-06-23T12:46:07.6881995Z ##[section]Finishing: Get Sources
2017-06-23T12:46:07.6901995Z ##[section]Starting: Post Job Cleanup
2017-06-23T12:46:07.6951999Z Cleaning any cached credential from repository: MyFirstProject (Git)
2017-06-23T12:46:07.6992000Z ##[command]git remote set-url origin https://ramandogra.visualstudio.com/_git/MyFirstProject
2017-06-23T12:46:07.7211998Z ##[command]git remote set-url --push origin https://ramandogra.visualstudio.com/_git/MyFirstProject
2017-06-23T12:46:07.7401991Z ##[section]Finishing: Post Job Cleanup
2017-06-23T12:46:07.7461997Z ##[section]Finishing: Build

PS:我是VSTS的第一次使用者。

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

这主要是因为您的jenkins基本网址是本地地址,例如http://computername:8080(或http://ip:8080)。但是其他人无法访问该URL。

检查以下内容是否可以使用本地网址:

  1. http://localhost:8080/configure中,使用Jenkins URL作为服务挂钩的Jenkins基本URL。 enter image description here

  2. 关闭本地计算机的防火墙。