Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Add PR validation on VSTS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate McMaster committed Aug 10, 2018
1 parent a85d99a commit a7a95c6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .vsts/builds/fast-pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger:
- master
- release/*

# See https://github.com/aspnet/BuildTools
resources:
repositories:
- repository: buildtools
type: github
endpoint: DotNet-Bot GitHub Connection
name: aspnet/BuildTools
ref: refs/heads/release/2.1

phases:
- template: .vsts-pipelines/templates/project-ci.yml@buildtools
parameters:
buildArgs: "/t:CheckUniverse"
14 changes: 9 additions & 5 deletions run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Re-installs KoreBuild
.PARAMETER ConfigFile
The path to the configuration file that stores values. Defaults to korebuild.json.
.PARAMETER CI
Sets up CI specific settings and variables.
.PARAMETER PackageVersionPropsUrl
(optional) the url of the package versions props path containing dependency versions.
Expand Down Expand Up @@ -61,8 +64,8 @@ in the file are overridden by command line parameters.
Example config file:
```json
{
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json",
"channel": "dev",
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json",
"channel": "master",
"toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools"
}
```
Expand All @@ -81,7 +84,8 @@ param(
[Alias('u')]
[switch]$Update,
[switch]$Reinstall,
[string]$ConfigFile,
[string]$ConfigFile = $null,
[switch]$CI,
[string]$PackageVersionPropsUrl = $null,
[string]$AccessTokenSuffix = $null,
[string]$RestoreSources = $null,
Expand Down Expand Up @@ -202,7 +206,7 @@ if (!$DotNetHome) {
else { Join-Path $PSScriptRoot '.dotnet'}
}

if (!$Channel) { $Channel = 'dev' }
if (!$Channel) { $Channel = 'master' }
if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' }

if ($PackageVersionPropsUrl) {
Expand Down Expand Up @@ -235,7 +239,7 @@ $korebuildPath = Get-KoreBuild
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')

try {
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI
Invoke-KoreBuildCommand $Command @MSBuildArguments
}
finally {
Expand Down
9 changes: 7 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reinstall=false
repo_path="$DIR"
channel=''
tools_source=''
ci=false
package_version_props_url=''
asset_root_url=''
access_token_suffix=''
Expand Down Expand Up @@ -48,6 +49,7 @@ __usage() {
echo " --product-build-id <ID> The product build ID for correlation with orchestrated builds."
echo " -u|--update Update to the latest KoreBuild even if the lock file is present."
echo " --reinstall Reinstall KoreBuild."
echo " --ci Apply CI specific settings and environment variables."
echo ""
echo "Description:"
echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be."
Expand Down Expand Up @@ -216,6 +218,9 @@ while [[ $# -gt 0 ]]; do
--reinstall|-Reinstall)
reinstall=true
;;
--ci|-[Cc][Ii])
ci=true
;;
--verbose|-Verbose)
verbose=true
;;
Expand Down Expand Up @@ -284,11 +289,11 @@ if [ ! -z "$product_build_id" ]; then
msbuild_args[${#msbuild_args[*]}]="-p:DotNetProductBuildId=$product_build_id"
fi

[ -z "$channel" ] && channel='dev'
[ -z "$channel" ] && channel='master'
[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools'

get_korebuild
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file"
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci"

# This incantation avoids unbound variable issues if msbuild_args is empty
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u
Expand Down

0 comments on commit a7a95c6

Please sign in to comment.