-1

I've created a Build definition in VSTS. I can trigger this build by creating a Pull Request. The build creates artifacts and uploads them to VSTS. I also created a Release definition that will download the artifacts created by the build and deploy them to environments. I can make the Release "go" automatically after the build is complete, or I can pause it and require a user or a member of a group of users to go into the release page on VSTS and approve it.

But what I want is to trigger the release when the PullRequest is approved or completed. Is this even possible? Should I be looking at only doing the build when the branch is not "master" and then create a separate build that only happens when the branch IS "master" and try to trigger the release from this second build?

  • What did you try? – 030 Dec 22 '17 at 21:03
  • well, I created a build definition, it executes some scripts, the scripts leave little "notes" to persist when they get called. It look like the build definition is invoked when the pull request is created. – Dennis TheBald Dec 27 '17 at 15:31
  • I added tasks that upload artifacts, and I created release definitions that copy these artifacts out to environments. – Dennis TheBald Dec 27 '17 at 15:33
  • I was able to invoke the release workflow from the build definition, however that happened after the pull request was created but before the PR was approved... not quite what I'm try to do. – Dennis TheBald Dec 27 '17 at 15:34
  • I see that I can trigger the release by clicking a html control labeled "release" while viewing the completed build. That' cool, but not what I'm trying for. I want to trigger the release workflow when the pull request is approved, and the branch merged into master. – Dennis TheBald Dec 27 '17 at 15:38
0

But what I want is to trigger the release when the PullRequest is approved or completed.

What is the definition of completed? I wonder whether that is possible. What I have seen in several environments and on github for example, the build is triggered when the branch has been merged into master.

Is this even possible?

I wonder whether this is possible and what is the advantage of this over starting a build when merged into master.

Should I be looking at only doing the build when the branch is not "master"

In my opinion the build should run when a build is created and when the code is merged into master.

and then create a separate build that only happens when the branch IS "master"

Yes, when the code is merged into master one could trigger a build.

and try to trigger the release from this second build?

Why should one release from the second build? In my opinion one could merge into master when the build was successful.

  • OK, thanks for your opinion. FWIW - "complete" is a button that one might click on the VSTS screen. Or one might "set for auto-complete" and then when all of the conditions are met, typically the approvals are garnered, the branch that is the target of the Pull Request is merged into master. – Dennis TheBald Jan 9 '18 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.