Skip to content

Commit f07db59

Browse files
committed
fixing pipelines build
1 parent 7598c1b commit f07db59

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,20 @@ jobs:
5656
pool:
5757
vmImage: 'vs2017-win2016'
5858
steps:
59-
- task: UseDotNet@2
60-
inputs:
61-
packageType: 'sdk'
62-
version: '2.2.x'
63-
performMultiLevelLookup: true
59+
- template: build/pipelines/usedotnet.yml
6460
- task: PowerShell@2
6561
displayName: "Build artifacts"
6662
inputs:
6763
filePath: '$(Build.Repository.LocalPath)\build.ps1'
6864
arguments: '-buildNumber "$(buildNumber)" -suffix "$(suffix)"'
6965
- task: CopyFiles@2
7066
inputs:
71-
SourceFolder: '..\..\..\buildoutput'
67+
SourceFolder: '$(Build.Repository.LocalPath)\buildoutput'
7268
Contents: 'WebJobs.Script.Performance.App*.nupkg'
7369
TargetFolder: '$(Build.ArtifactStagingDirectory)\Performance'
7470
- task: CopyFiles@2
7571
inputs:
76-
SourceFolder: '..\..\buildoutput'
72+
SourceFolder: '$(Build.Repository.LocalPath)\buildoutput'
7773
Contents: '*.nupkg'
7874
TargetFolder: '$(Build.ArtifactStagingDirectory)'
7975
- task: CopyFiles@2
@@ -112,11 +108,7 @@ jobs:
112108
pool:
113109
vmImage: 'vs2017-win2016'
114110
steps:
115-
- task: UseDotNet@2
116-
inputs:
117-
packageType: 'sdk'
118-
version: '2.2.x'
119-
performMultiLevelLookup: true
111+
- template: build/pipelines/usedotnet.yml
120112
- task: DotNetCoreCLI@2
121113
displayName: 'Unit Tests'
122114
inputs:
@@ -131,11 +123,7 @@ jobs:
131123
pool:
132124
vmImage: 'vs2017-win2016'
133125
steps:
134-
- task: UseDotNet@2
135-
inputs:
136-
packageType: 'sdk'
137-
version: '2.2.x'
138-
performMultiLevelLookup: true
126+
- template: build/pipelines/usedotnet.yml
139127
- task: UseNode@1
140128
inputs:
141129
version: '10.x'
@@ -187,11 +175,7 @@ jobs:
187175
pool:
188176
vmImage: 'vs2017-win2016'
189177
steps:
190-
- task: UseDotNet@2
191-
inputs:
192-
packageType: 'sdk'
193-
version: '2.2.x'
194-
performMultiLevelLookup: true
178+
- template: build/pipelines/usedotnet.yml
195179
- task: UseNode@1
196180
inputs:
197181
version: '10.x'

build.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function AddDiaSymReaderToPath()
108108

109109
$parent = Split-Path -Path $sdkBasePath.Trim()
110110
$maxValue = 0
111-
Get-ChildItem $parent\2.2.* |
111+
Get-ChildItem $parent\2.2.* | ?{ $_.PSIsContainer } |
112112
ForEach-Object {
113113
$newVal = $_.Extension -replace '\.',''
114114
if($newVal -gt $maxValue) {
@@ -280,7 +280,8 @@ function cleanExtension([string] $bitness) {
280280
Get-ChildItem "$privateSiteExtensionPath\$bitness\workers\powershell\runtimes" -Exclude $keepRuntimes -ErrorAction SilentlyContinue |
281281
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
282282
}
283-
283+
284+
dotnet --info
284285
dotnet --version
285286
dotnet build .\WebJobs.Script.sln -v q /p:BuildNumber="$buildNumber"
286287

@@ -296,12 +297,12 @@ $projects =
296297
foreach ($project in $projects)
297298
{
298299

299-
$cmd = "pack", "src\$project\$project.csproj", "-o", "..\..\buildoutput", "--no-build" , "-p:PackageVersion=$extensionVersion"
300+
$cmd = "pack", "src\$project\$project.csproj", "-o", "$buildoutput", "--no-build" , "-p:PackageVersion=$extensionVersion"
300301

301302
& dotnet $cmd
302303
}
303304

304-
$cmd = "pack", "tools\WebJobs.Script.Performance\WebJobs.Script.Performance.App\WebJobs.Script.Performance.App.csproj", "-o", "..\..\..\buildoutput"
305+
$cmd = "pack", "tools\WebJobs.Script.Performance\WebJobs.Script.Performance.App\WebJobs.Script.Performance.App.csproj", "-o", "$buildoutput"
305306
& dotnet $cmd
306307

307308
AddDiaSymReaderToPath

build/pipelines/usedotnet.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
steps:
2+
- task: PowerShell@2
3+
displayName: 'Set default dotnet path'
4+
inputs:
5+
targetType: 'inline'
6+
script: |
7+
$infoContent = dotnet --info
8+
$sdkBasePath = $infoContent |
9+
Where-Object {$_ -match 'Base Path:'} |
10+
ForEach-Object {
11+
($_ -replace '\s+Base Path:','').trim()
12+
}
13+
Write-Host "dotnet SDK path: $sdkBasePath"
14+
$dotnetPath = (Get-Item $sdkBasePath).Parent.Parent.FullName
15+
Write-Host "dotnet path: $dotnetPath"
16+
Write-Host "##vso[task.setvariable variable=DotNetPath]$dotnetPath"
17+
- task: UseDotNet@2
18+
inputs:
19+
packageType: 'sdk'
20+
version: '2.2.207'
21+
installationPath: $(DotNetPath)

0 commit comments

Comments
 (0)