forked from Azure/azure-functions-java-worker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
e2e-nightly-cli-azure-pipelines.yml
93 lines (92 loc) · 3.72 KB
/
e2e-nightly-cli-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
# 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
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NuGetToolInstaller@0
inputs:
checkLatest: true
- pwsh: |
Get-Command mvn
displayName: 'Installing Maven'
- pwsh: |
$buildNumber = 0
if($env:APPVEYOR_REPO_TAG -eq "true") {
$buildNumber = $(Build.SourceBranchName)
Write-Host “Found git tag."
}
else {
$buildNumber = "1.5.3-$(Build.BuildId)"
Write-Host “git tag not found. Setting package suffix to '$buildNumber'"
}
.\package.ps1 -buildNumber $buildNumber
displayName: 'Executing build script'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/pkg'
Contents: '*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
displayName: 'Copying files for artifacts'
- pwsh: |
.\setup-tests.ps1
displayName: 'Setting tests'
- pwsh: |
.\run-tests.ps1
env:
AzureWebJobsStorage: $(AzureWebJobsStorage)
AzureWebJobsCosmosDBConnectionString: $(AzureWebJobsCosmosDBConnectionString)
AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
AzureWebJobsEventHubReceiver: $(AzureWebJobsEventHubReceiver)
AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender)
AzureWebJobsEventHubPath: $(AzureWebJobsEventHubPath)
SBTopicName: $(SBTopicName)
SBTopicSubName: $(SBTopicSubName)
CosmosDBDatabaseName: $(CosmosDBDatabaseName)
SBQueueName: $(SBQueueName)
AzureWebJobsEventHubSender_2: $(AzureWebJobsEventHubSender_2)
displayName: 'running tests'
continueOnError: true
- pwsh: |
Compress-Archive -Path $(System.DefaultWorkingDirectory)\endtoendtests\target\azure-functions\azure-functions-java-endtoendtests\* -DestinationPath $(System.DefaultWorkingDirectory)\endtoendtests\e2etestsjava.zip
displayName: 'Create test app zip file'
- pwsh: |
Install-Module Az.Storage -Force -Verbose -Scope CurrentUser
if (-not (Get-command new-azstoragecontext -ea SilentlyContinue))
{
throw "new-azstoragecontext is not present"
}
$localFile = '$(System.DefaultWorkingDirectory)\endtoendtests\e2etestsjava.zip'
if (Test-Path $localFile)
{
Write-Host "File exists"
}
$blobName = 'e2etestsjava.zip'
$Context = New-AzStorageContext -StorageAccountName $(StorageAccountName) -StorageAccountKey $(StorageAccountKey)
Set-AzStorageBlobContent -File $localFile -Container $(ContainerName) -Blob $blobName -Context $Context -Force -Verbose
env:
AzureFunctionsE2ETestStorage: $(AzureFunctionsE2ETestStorage)
displayName: 'Copying test app zip artifacts to blob'
- pwsh: |
Compress-Archive -Path '$(Build.Repository.LocalPath)\pkg\*' -DestinationPath $(System.DefaultWorkingDirectory)\javaworker.zip
displayName: 'Create test app zip file'
- pwsh: |
$localFileJavaWorker = '$(System.DefaultWorkingDirectory)\javaworker.zip'
if (Test-Path $localFileJavaWorker)
{
Write-Host "localFileJavaWorker file exists"
}
$blobNameJavaWorker = 'javaworker.zip'
$Context = New-AzStorageContext -StorageAccountName $(StorageAccountName) -StorageAccountKey $(StorageAccountKey)
Set-AzStorageBlobContent -File $localFileJavaWorker -Container $(ContainerName) -Blob $blobNameJavaWorker -Context $Context -Force -Verbose
env:
AzureFunctionsE2ETestStorage: $(AzureFunctionsE2ETestStorage)
displayName: 'Copying java worker zip to blob'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publishing build and test result artifacts'