In VSTS build and release, I am now trying to separate out my code compilation and testing into separate phases for a build plan.
The first phase is fine, it does a git clean and gets sources and all that. However, the second phase should just start executing after the first phase is done. Instead it runs the git clean and reset and get sources AGAIN. Why would a phase do this if it is part of one build? I cannot for the life of me figure out a way to turn this off.
It is also entirely possible that I am thinking about this incorrectly and should be doing testing in the release pipeline or something like that.
Anyway tl;dr How do I turn off the get sources for a secondary phase in a build
The get sources step and clean setting is independent of a specific agent phase. It's in the top of the build definition when you create a new one.
An agent phase is a way of defining a sequence of tasks that will run on one or more agents. At run time, one or more jobs are created to be run on agents that match the demands specified in the phase properties.
There is no such related setting in a configuration of agent phase. You could not turn off the get sources for a secondary phase in a build.
As a workaround, you could try to turn off the entire get sources step in the build definition, and directly use powershell script to do a get source in single agent phase. Detail steps please refer my reply in this question: Is it able to ignore/disable the first step Get source in vNext Build?
Moreover, about the concepts and features in agent phase, please refer this tutorial: Phases in Build and Release Management
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With