Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger jenkins build when changes are commited to TFS?

Tags:

jenkins

tfs

I have a maven project in Jenkins (which is a selenium- java project), web-Developers use TFS , I want to execute my selenium tests as soon as developers push their code change to TFS.

like image 306
DiPaK JaDhAv Avatar asked Nov 28 '15 12:11

DiPaK JaDhAv


1 Answers

If you are using Visual Studio Team Services, then you can store your code in Visual Studio Team Services and continue to use Jenkins for your continuous integration builds. You can trigger a Jenkins build when you push code to your team project's Git repository or when you check code in to Team Foundation version control:

  1. If you haven't already, set up a Jenkins server. If you're setting up Jenkins on-premises, enable HTTPS.

  2. In Jenkins, create a new item. Create the type of build that's appropriate for your project.

  3. Set the URL for your Git repository in Visual Studio Team Services. The URL is in the form https://{VSTS account}.visualstudio.com/DefaultCollection/_git/{team project}.

  4. If you haven't already, enable alternate credentials in your Visual Studio Team Services profile. Be sure to set a secondary user name because you won't be able to use your email account to connect Visual Studio Team Services to Jenkins.

  5. Go to your team project's administration page. On the Service Hooks tab, create a subscription. Add Jenkins.

  6. Pick the event from Visual Studio Team Services that you want to trigger a Jenkins build.

  7. Configure the action to take in Jenkins. Now, when that event occurs in Visual Studio Team Services, your Jenkins build will be triggered.

Check:https://www.visualstudio.com/en-us/get-started/integrate/service-hooks/jenkins-and-vso-vs

like image 138
Cece Dong - MSFT Avatar answered Nov 15 '22 08:11

Cece Dong - MSFT