On my current project we’re using Jenkins as a CI platform and Visual Studio Online with TFS for source control. I’ve been wanting to setup the builds on our intranet again to run the integration tests relying on intranet access each check-in. I had an issue with this, as I did last time I tried it and figured I need to retain this information somewhere.
If you are doing this with using Git you’ve come to the wrong place though, Microsoft has a great article about that themselves.
This is the error I ended up getting:
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: The SOAP endpoint https://infuse.visualstudio.com/Services/v1.0/Registration.asmx could not be contacted. HTTP status: 404
java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: The SOAP endpoint https://infuse.visualstudio.com/Services/v1.0/Registration.asmx could not be contacted. HTTP status: 404
The issue was finding the right URL to use, which is the base URL for your VSO project including DefaultCollection. I.e. https://fabrikam.visualstudio.com/DefaultCollection. You can find this if you look really, really closely at the change history of the plug in.
- Have a Jenkins server
- Install the Visual Studio Plugin
- Click Manage Jenkins then Manage plugins
- Switch to Available tab
- Filter for Team Foundation Server Plug-in and install
- Create a personal access token for VSO
- Log into VSO
- In the upper right corner, click on your name, My profile and then the Security tab
- Add and follow instructions, make sure you copy the password because once that’s lost its lost. That’s the idea behind a token. When it expires you’ll create a new one the same way.
- Setup a new build project (probably freestyle unless you’ve got other needs)
- Under source code management select Team foundation server this will give you some new options
- As mentioned above, you want to use your email and the token you created for authentication. As for the server URL, that should be your VSO DefaultCollection url and the source path you can find by selecting a folder under Code in VSO and getting the path that begins with $.
- As for when to trigger the build I choose to do it every fifteen minutes using a Poll SCM trigger with the following value
1H/15 * * * *
- Then the build step of course
The node running this job has msbuild (visual studio) installed of course and I also had to manually append the msbuild bin folder to the system %PATH% variable in order for Jenkins to execute it. Since the path variable is defined when launching the jenkins client I had to restart that to get it working as well.
In the end all is well and that’s “all” you have to do to get it working.. It does save a lot of time in the long run though.