Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .exp-insertions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ parameters:
# Dotnet installer channel from which to take the latest dotnet bits.
- name: DotnetInstallerChannel
displayName: Dotnet installer channel
type: string
type: string
default: 'none'
# VS version for which to take the latest Retail MSBuild bits.
- name: VSVersionName
displayName: VS Version
type: string
default: 'none'
# Branch from the MSBuild Build CI pipeline. Default: main
# Top run for the branch would be used to create an experimental insertion.
# Top run for the branch would be used to create an experimental insertion.
- name: MSBuildBranch
displayName: MSBuild Branch
type: string
default: 'refs/heads/main'
# BuildID from the MSBuild Build CI pipeline. Overrides the choice of MSBuildBranch parameter
# BuildID from the MSBuild Build CI pipeline. Overrides the choice of MSBuildBranch parameter
- name: MSBuildBuildID
displayName: MSBuild CI Run Override
type: string
Expand All @@ -29,22 +29,14 @@ parameters:
variables:
- name: _MsBuildCiPipelineId
value: 9434
- name: _MSBuildConfigFilePath
value: "config/batmon/Q-Prod-Co3/Coordinator/ToolsReleaseConfig-GeneralPublic.json"
- name: _MSBuildConfigFilePathRequestURL
value: 'https://dev.azure.com/cloudbuild/CloudBuild/_apis/git/repositories/CloudBuildConfig/items?versionDescriptor.version=main&path=config/batmon/Q-Prod-Co3/Coordinator/ToolsReleaseConfig-GeneralPublic.json&api-version=5.0'
- name: VSVersion
value: ${{parameters.VSVersionName}}

pool:
vmImage: windows-latest

resources:
repositories:
- repository: CloudBuildConfig
type: git
name: CloudBuild/CloudBuildConfig
endpoint: CloudBuild_Test
ref: refs/heads/main

jobs:
- job: CreateExpDotnet
displayName: Create Experimental Dotnet
Expand All @@ -70,14 +62,15 @@ jobs:
inputs:
buildType: specific
project: DevDiv
pipeline: $(_MsBuildCiPipelineId)
${{ if eq(parameters.MSBuildBuildID, 'default') }}:
pipeline: $(_MsBuildCiPipelineId)
${{ if eq(parameters.MSBuildBuildID, 'default') }}:
buildVersionToDownload: latestFromBranch
branchName: '${{parameters.MSBuildBranch}}'
${{ else }}:
buildVersionToDownload: specific
buildId: ${{parameters.MSBuildBuildID}}
buildId: ${{parameters.MSBuildBuildID}}
artifactName: bin
itemPattern: 'MSBuild.Bootstrap/**'
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin'
displayName: Download msbuild artifacts

Expand All @@ -86,26 +79,26 @@ jobs:

Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.zip"
Expand-Archive "$(System.ArtifactsDirectory)/installer/$sdk.zip" -DestinationPath "$(Pipeline.Workspace)/exp-dotnet/$sdk"

$dotnetDirectory = Get-ChildItem -Directory -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk"
$dotnetVersion = $dotnetDirectory.Name
Write-Host "Detected dotnet version: $dotnetVersion"

Write-Host "Updating MSBuild dlls."
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 `
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" `
-binDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin" `
-configuration Release `
-makeBackup $false

Write-Host "Compressing dotnet sdk files"
Get-ChildItem -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk" | Compress-Archive -DestinationPath "$(Pipeline.Workspace)/artifacts/$sdk.zip"

displayName: Dogfood msbuild dlls to dotnet sdk win-x64

- powershell: |
$sdk = "dotnet-sdk-linux-x64"

mkdir "$(Pipeline.Workspace)/exp-dotnet/$sdk"

Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.tar.gz"
Expand All @@ -114,14 +107,14 @@ jobs:
$dotnetDirectory = Get-ChildItem -Directory -Path $(Pipeline.Workspace)/exp-dotnet/$sdk/sdk
$dotnetVersion = $dotnetDirectory.Name
Write-Host "Detected dotnet version: $dotnetVersion"

Write-Host "Updating MSBuild dlls."
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 `
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" `
-binDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin" `
-configuration Release `
-makeBackup $false

Write-Host "Compressing dotnet sdk files"
tar -czvf "$(Pipeline.Workspace)/artifacts/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" .
displayName: Dogfood msbuild dlls to dotnet sdk linux-x64
Expand All @@ -139,17 +132,17 @@ jobs:
displayName: "Create Experimental MSBuild"
condition: ne('${{ parameters.VSVersionName }}', 'none')
steps:
- checkout: self

- checkout: CloudBuildConfig

- powershell: |
$json = (Get-Content "$(Build.SourcesDirectory)/CloudBuildConfig/$(_MSBuildConfigFilePath)" -Raw) | ConvertFrom-Json
$MSBuildDropPath = $json.Tools.MSBuild.Locations
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("PAT:$env:ACCESSTOKEN"))
$headers = @{ Authorization = "Basic $token" };
$response = Invoke-RestMethod -Uri "$(_MSBuildConfigFilePathRequestURL)" -Headers $headers -Method Get
$MSBuildDropPath = $response.Tools.MSBuild.Locations
Write-Host "##vso[task.setvariable variable=MSBuildDropPath]$MSBuildDropPath"
Write-Host "MSBuild Drop Path directory: $MSBuildDropPath"
displayName: Get Retail MSBuild Drop Path

env:
ACCESSTOKEN: $(cloudbuild-token)

- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'

Expand All @@ -158,18 +151,18 @@ jobs:
inputs:
command: restore
feedsToUse: config
restoreSolution: '$(Build.SourcesDirectory)\DotNet-msbuild-Trusted\eng\common\internal\Tools.csproj'
nugetConfigPath: '$(Build.SourcesDirectory)\DotNet-msbuild-Trusted\NuGet.config'
restoreDirectory: '$(Build.SourcesDirectory)\DotNet-msbuild-Trusted\.packages'
restoreSolution: '$(Build.SourcesDirectory)\eng\common\internal\Tools.csproj'
nugetConfigPath: '$(Build.SourcesDirectory)\NuGet.config'
restoreDirectory: '$(Build.SourcesDirectory)\.packages'

- powershell: |
mkdir "$(Pipeline.Workspace)/artifacts"
$dropAppDirectory = Get-ChildItem -Directory -Path "$(Build.SourcesDirectory)/DotNet-msbuild-Trusted/.packages/drop.app"

$dropAppDirectory = Get-ChildItem -Directory -Path "$(Build.SourcesDirectory)/.packages/drop.app"
$dropAppVersion = $dropAppDirectory.Name
Write-Host "Detected drop.exe version: $dropAppVersion"

$dropExePath = "$(Build.SourcesDirectory)/DotNet-msbuild-Trusted/.packages/drop.app/$dropAppVersion/lib/net45/drop.exe"
$dropExePath = "$(Build.SourcesDirectory)/.packages/drop.app/$dropAppVersion/lib/net45/drop.exe"
Write-Host "Detected drop.exe path: $dropExePath"

Write-Host "Downloading VS msbuild"
Expand All @@ -182,25 +175,32 @@ jobs:
displayName: Download msbuild vs drop
env:
cloudbuild-token: $(cloudbuild-token)

- task: DownloadBuildArtifacts@1
inputs:
buildType: specific
project: DevDiv
pipeline: $(_MsBuildCiPipelineId)
${{ if eq(parameters.MSBuildBuildID, 'default') }}:
pipeline: $(_MsBuildCiPipelineId)
${{ if eq(parameters.MSBuildBuildID, 'default') }}:
buildVersionToDownload: latestFromBranch
branchName: '${{parameters.MSBuildBranch}}'
${{ else }}:
buildVersionToDownload: specific
buildId: ${{parameters.MSBuildBuildID}}
buildId: ${{parameters.MSBuildBuildID}}
artifactName: bin
itemPattern: |
MSBuild.Bootstrap/*/net472/**
Microsoft.Build.Conversion/*/net472/Microsoft.Build.Conversion.Core.dll
Microsoft.Build.Engine/*/net472/Microsoft.Build.Engine.dll
MSBuildTaskHost/**/MSBuildTaskHost.exe
MSBuildTaskHost/**/MSBuildTaskHost.pdb
MSBuild/*/*/net472/MSBuild.exe*
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin'
displayName: Download msbuild artifacts

- powershell: |
Write-Host "Updating MSBuild dlls."
$(Build.SourcesDirectory)/DotNet-msbuild-Trusted/scripts/Deploy-MSBuild.ps1 `
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 `
-destination "$(Pipeline.Workspace)/VSMSBuild/$(VSVersion)/MSBuild/Current/Bin" `
-binDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin" `
-configuration Release `
Expand All @@ -209,7 +209,7 @@ jobs:
ls "$(Pipeline.Workspace)/VSMSBuild/$(VSVersion)"
Write-Host "Compressing msbuild files"
Get-ChildItem -Path "$(Pipeline.Workspace)/VSMSBuild/$(VSVersion)" | Compress-Archive -DestinationPath "$(Pipeline.Workspace)/artifacts/MSBuild.zip"
displayName: Dogfood msbuild dlls
displayName: Dogfood msbuild dlls

- task: PublishPipelineArtifact@1
inputs:
Expand Down