forked from Azure/azure-functions-powershell-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
95 lines (81 loc) · 3.25 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
#trigger:
#- master
#- dev
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
windows:
imageName: 'vs2017-win2016'
pool:
vmImage: $(imageName)
variables:
Configuration: Release
buildNumber: $[ counter('build', 400) ] # Start higher than our AppVeyor versions. Every build (pr or branch) will increment.
steps:
- pwsh: ./build.ps1 -NoBuild -Bootstrap
displayName: 'Running ./build.ps1 -NoBuild -Bootstrap'
- pwsh: |
$ErrorActionPreference = "Stop"
./build.ps1 -Clean -Configuration Release -BuildNumber "$(buildNumber)"
displayName: 'Build worker code'
- pwsh: ./build.ps1 -NoBuild -Test
displayName: 'Running UnitTest'
- pwsh: ./test/E2E/Start-E2ETest.ps1
env:
AzureWebJobsStorage: $(AzureWebJobsStorage)
AzureWebJobsCosmosDBConnectionString: $(AzureWebJobsCosmosDBConnectionString)
AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender)
FUNCTIONS_WORKER_RUNTIME : "powershell"
displayName: 'Running E2ETest'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*.trx'
failTaskOnFailedTests: true
condition: succeededOrFailed()
displayName: 'Publish tests results'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/package'
Contents: '**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Copy package to artifacts directory'
- pwsh: |
$uploadPackage = $null
if (-not ([bool]::TryParse($env:UPLOADPACKAGETOPRERELEASEFEED, [ref] $uploadPackage)))
{
throw "UploadPackageToPreReleaseFeed can only be set to True or False. Current value is set to $env:UPLOADPACKAGETOPRERELEASEFEED"
}
Write-Host "##vso[task.setvariable variable=UploadPackage]$uploadPackage"
Write-Host "UploadPackage: $uploadPackage"
displayName: 'Set UploadPackage variable'
- task: NuGetCommand@2
condition: and(ne(variables['Build.Reason'], 'PullRequest'), in(variables['Build.SourceBranch'], 'refs/heads/v3.x/ps7', 'refs/heads/v3.x/ps6', 'refs/heads/v2.x'), eq(variables.UploadPackage, false))
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'e6a70c92-4128-439f-8012-382fe78d6396/c0493cce-bc63-4e11-9fc9-e7c45291f151'
allowPackageConflicts: true
displayName: 'Push NuGet package'
- task: NuGetCommand@2
condition: eq(variables.UploadPackage, true)
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'e6a70c92-4128-439f-8012-382fe78d6396/f37f760c-aebd-443e-9714-ce725cd427df'
allowPackageConflicts: true
displayName: 'Push NuGet package to the AzureFunctionsPreRelease feed'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish build artifacts'