Skip to content

Commit

Permalink
Tweak ci build script to support CI build targeting any source branch. (
Browse files Browse the repository at this point in the history
#1118)

* Removed deprecated build definitions.
* Added support to explicitly specify source branch.
* Note: Source branch could probably be determined from upstream remote,
* but it is not very reliable.  Also, explicit parameter allows kicking
* off arbitrary builds.

Fix #1089
  • Loading branch information
Raj Seshasankaran committed Oct 11, 2016
1 parent f2215dc commit 5cca890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
16 changes: 5 additions & 11 deletions .ci-repo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@
<ID Configuration="Release">72</ID>
<ConfigMappings>
<Parameter Key="PullRequest">$REMOTEURL $BRANCH</Parameter>
<SourceBranch>$SOURCEBRANCH</SourceBranch>
</ConfigMappings>
</BuildDefinitionSet>
<BuildDefinitionSet Name="VSO Any Branch" MatchRemote="*visualstudio*">
<ID Configuration="Debug">78</ID>
<ID Configuration="Release">79</ID>
<BuildDefinitionSet Name="Full"> <!-- No MatchRemote as this one must be specified by BuildFilter -->
<ID Configuration="Debug">82</ID>
<ID Configuration="Release">83</ID>
<ConfigMappings>
<SourceBranch>$BRANCH</SourceBranch>
</ConfigMappings>
</BuildDefinitionSet>
<BuildDefinitionSet Name="VSO Full"> <!-- No MatchRemote as this one must be specified by BuildFilter -->
<ID Configuration="Debug">89</ID>
<ID Configuration="Release">90</ID>
<ConfigMappings>
<SourceBranch>$BRANCH</SourceBranch>
<SourceBranch>$SOURCEBRANCH</SourceBranch>
</ConfigMappings>
</BuildDefinitionSet>
</BuildDefinitions>
Expand Down
3 changes: 2 additions & 1 deletion tools/build/Submit-CIBuilds.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Param (
[switch]$Reconfigure,
[switch]$SkipRemoteCheck,
[string]$BuildFilter,
[string]$SourceBranch='develop',

[string]$AuthUsername,
[string]$AuthToken
Expand Down Expand Up @@ -273,7 +274,7 @@ ForEach($definitionSet in $matchingDefinitions) {
$parameters[$parameter.Key] = $parameter.InnerText.Replace("`$REMOTEURL", $RemoteURL).Replace("`$BRANCH", $Ref)
}
If ($definitionSet.ConfigMappings.SourceBranch) {
$requestBody.sourceBranch = $definitionSet.ConfigMappings.SourceBranch.Replace("`$BRANCH", $Ref)
$requestBody.sourceBranch = $definitionSet.ConfigMappings.SourceBranch.Replace("`$SOURCEBRANCH", $SourceBranch)
}
$requestBody.parameters = (ConvertTo-JSON -Compress $parameters)

Expand Down

0 comments on commit 5cca890

Please sign in to comment.