Skip to content

Commit

Permalink
properly define variables in case they were not set
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Jul 26, 2021
1 parent ea39faf commit a3f7f7c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions eng/pipelines/insert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ parameters:
type: string
default: ''

# Defined variables that may be overwridden depending on the input parameters.
variables:
- name: Template.ComponentAzdoUri
value: ''
- name: Template.ComponentProjectName
value: ''

steps:
- checkout: none

Expand All @@ -37,9 +44,10 @@ steps:
command: custom
arguments: 'install RoslynTools.VisualStudioInsertionTool -PreRelease -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'

# If we were passed a component build project name, set the corresponding uri and project name so we can retrieve the build.
- powershell: |
Write-Host "##vso[task.setvariable variable=Insertion.ComponentAzdoUri]$($(System.CollectionUri))"
Write-Host "##vso[task.setvariable variable=Insertion.ComponentProjectName]$(${{ parameters.componentBuildProjectName }})"
Write-Host "##vso[task.setvariable variable=Template.ComponentAzdoUri]$($(System.CollectionUri))"
Write-Host "##vso[task.setvariable variable=Template.ComponentProjectName]$(${{ parameters.componentBuildProjectName }})"
displayName: Set Insertion Variables
condition: ne('${{ parameters.componentBuildProjectName }}', '')
Expand All @@ -51,8 +59,8 @@ steps:
-cherryPick "(default)" `
-clientId "${{ parameters.clientId }}" `
-clientSecret "${{ parameters.clientSecret }}" `
-componentAzdoUri "$(Insertion.ComponentAzdoUri)" `
-componentProjectName "$(Insertion.ComponentProjectName)" `
-componentAzdoUri "$(Template.ComponentAzdoUri)" `
-componentProjectName "$(Template.ComponentProjectName)" `
-componentName "Roslyn" `
-componentGitHubRepoName "dotnet/roslyn" `
-componentBranchName "${{ parameters.componentBranchName }}" `
Expand Down

0 comments on commit a3f7f7c

Please sign in to comment.