Reputation: 20053
I'm trying to get continuous delivery going with Jenkins (building, deploying) and VSTS (source control). This is the desired workflow:
I was using Service Hooks within VSTS to detect the merge to master and execute a Jenkins task. VSTS has 3 hooks I can use:
I was under the impression that the third option would only occur when a PR was merged, but that's not the case. Any additional commits to the branch, while it's associated with the PR triggers the hook. This causes a bunch of unnecessary deployments.
I figured I could make Jenkins detect changes within VSTS. There's a "Poll SCM" option, which takes a cron-like schedule. The utterly confusing thing is, it doesn't appear that I can configure what exactly will be polled every X minutes (which repo, which branch).
What are my options here to trigger Jenkins tasks only when a PR is merged to master? I would use the VSTS "Code pushed" Service Hook, but it goes into an infinite loop because Jenkins pushes to master when it increments the version.
Upvotes: 0
Views: 461
Reputation: 33698
Refer to these steps below:
Upvotes: 1