Build reason seems very straightforward to understand.. However it can give some surprises – at least it gave to me. So here comes some explanation how doe it look like on a bit deeper level.
Build Reason values
|Combinations /||CheckInShelveset /||ValidateShelveset/||UserCreated /||ScheduleForced /||Schedule /||BatchedCI /||IndividualCI /||Manual|
Ok.. but what values shall I get when I start a build?
|Manual start, Latest sources||Manual|
|Manual start, Latest sources with shelveset||ValidateShelveset / CheckInShelveset|
|Scheduled||Schedule / ScheduleForced|
How to use Build Reason in the build workflow
- You can find the build reason in the BuildDetail variable of the default workflow.
- If you have something special, you can get this object with the GetBuildDetail activity, which returns with an IBuildDetail instance, which has it in its Reason property.
- You can simply use the InvokeForReason activity if you want to execute some activities for some specific build reasons only.
Effects of the Build Reason
I have not tried all, just collecting the usages and side effects of it…
– In the default build process, the Drop Folder is not created, when the BuildReason is ValidateShelveset or None, even if droplocation is specified and Copy Outputs to Drop Folder is true. In other words, if you just build a shelveset, then it won’t have any drop folder, even if you are trying to write log file into it. (Obviously you can align your wokflow to solve this…)