Search code examples
azure-devopsoctopus-deployoctopack

vs team services trigger build with commit message


Background

I have a project set up in VSTS, which builds my solution and runs octopack to push the package to my octopus deploy feed. I am using a local build agent and a local octopus deploy server.

The build is currently manually triggered.

The project is worked on frequently, with multiple commits.

Branching is not currently used, there are various reasons for this, it's not ideal but it's what I have to work with for now.

The problem

Not all commits to the project should be deployed. CI triggers and scheduled triggers will result in multiple packages being pushed to octopus deploy. Not all of these will be release candidates.

I want to move away from manually triggering the build. The long-term goal is to have someone else run the octopus deploy release without my involvement.

The question

Is it possible to trigger either the VSTS build or octopack using commit messages?

If not, is there any other way of solving this problem, or am I stuck with manual triggers until I can sort the branching problems?


Solution

  • No, there isn't any way to trigger VSTS build or octopack via commit message.

    The alternative way would be add a powershell task at the begin of your build definition to check the latest commit message. If the commit message contain the words to ask for build, then go on. Otherwise fail the build directly. However this will lead many failed builds. Or you can create one more build definition which triggered by commit. The definition only include one powershell task to check the latest commit message. When the commit message contains the words to ask for build, then trigger your original build definition via VSTS Rest API, otherwise, do nothing.