-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
104 lines (99 loc) · 5.12 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
96
97
98
99
100
101
102
103
104
trigger:
branches:
include:
- master
- main
- feature/*
tags:
include:
- '*'
parameters:
- name: ForcePublish
type: boolean
default: false
displayName: When checked, a new release will be created and NuGet packages published; otherwise only 'master' branch changes will be published
- name: InternalPublish
type: boolean
default: false
displayName: When checked, NuGet packages will be published to an internal feed; this is independent of whether a public release is performed
- name: ForceRelease
type: boolean
default: false
displayName: When checked, a GitHub Release will be created but NuGet packages will not be published (unless other options are enabled)
resources:
repositories:
- repository: recommended_practices
type: github
name: endjin/Endjin.RecommendedPractices.AzureDevopsPipelines.GitHub
endpoint: marain-dotnet-github
variables:
Endjin.ForcePublish: ${{ parameters.ForcePublish }}
Endjin.InternalPublish: ${{ parameters.InternalPublish }}
Endjin.ForceRelease: ${{ parameters.ForceRelease }}
jobs:
- template: templates/build.and.release.scripted.yml@recommended_practices
parameters:
vmImage: 'windows-latest'
service_connection_nuget_org: $(Endjin_Service_Connection_NuGet_Org)
service_connection_github: $(Endjin_Service_Connection_GitHub)
solution_to_build: $(Endjin_Solution_To_Build)
compileTasksServiceConnection: endjin-acr-reader
postCustomEnvironmentVariables:
- powershell: |
Write-Host "##vso[task.setvariable variable=TestBlobStorageConfiguration__AccountName]$Env:ENDJIN_BLOBSTORAGEACCOUNTNAME"
Write-Host "##vso[task.setvariable variable=TestBlobStorageConfiguration__AccessKeyInKeyVault__SecretName]$Env:ENDJIN_BLOBSTORAGEACCOUNTKEYSECRETNAME"
Write-Host "##vso[task.setvariable variable=TestBlobStorageConfiguration__AccessKeyInKeyVault__VaultName]$Env:ENDJIN_BLOBSTORAGEKEYVAULTNAME"
Write-Host "##vso[task.setvariable variable=AzureServicesAuthConnectionString]$Env:ENDJIN_AZURESERVICESAUTHCONNECTIONSTRING"
Write-Host "##vso[task.setvariable variable=TenancyClient__TenancyServiceBaseUri]$Env:ENDJIN_MARAINTENANCYBASEURL"
Write-Host "##vso[task.setvariable variable=TenancyClient__ResourceIdForMsiAuthentication]$Env:ENDJIN_MARAINTENANCYRESOURCEIDFORMSIAUTHENTICATION"
Write-Host "##vso[task.setvariable variable=MarainServiceConfiguration__ServiceDisplayName]$Env:ENDJIN_MARAINCLAIMSSERVICEDISPLAYNAME"
Write-Host "##vso[task.setvariable variable=MarainServiceConfiguration__ServiceTenantId]$Env:ENDJIN_MARAINCLAIMSSERVICETENANTID"
displayName: 'Set Azure Connection String Environment Variable'
env:
ENDJIN_BLOBSTORAGEACCOUNTNAME: $(Endjin_BlobStorageAccountName)
ENDJIN_BLOBSTORAGEACCOUNTKEYSECRETNAME: $(Endjin_BlobStorageAccountKeySecretName)
ENDJIN_BLOBSTORAGEKEYVAULTNAME: $(Endjin_BlobStorageKeyVaultName)
ENDJIN_AZURESERVICESAUTHCONNECTIONSTRING: $(Endjin_AzureServicesAuthConnectionString)
ENDJIN_MARAINTENANCYBASEURL: $(Endjin_MarainTenancyBaseUrl)
ENDJIN_MARAINTENANCYRESOURCEIDFORMSIAUTHENTICATION: $(Endjin_MarainTenancyResourceIdForMsiAuthentication)
ENDJIN_MARAINCLAIMSSERVICEDISPLAYNAME: $(Endjin_MarainClaimsServiceDisplayName)
ENDJIN_MARAINCLAIMSSERVICETENANTID: $(Endjin_MarainClaimsServiceTenantId)
- task: Npm@1
displayName: 'Install Latest Azure Functions V4 Runtime'
inputs:
command: custom
verbose: false
customCommand: 'install -g azure-functions-core-tools@4 --unsafe-perm true'
- task: UseDotNet@2
displayName: 'Install Microsoft.AspNetCore.App for .NET Core 3.1 '
inputs:
# For as long as we have tests that target .NET Core 3.1, we need this.
# In theory we only need this:
# packageType: runtime
# However, it turns out that there's no way to ask for the runtime plus
# frameworks, and the official workaround is to install the entire
# SDK. :(
# https://github.com/microsoft/azure-pipelines-tasks/issues/14405#issuecomment-784221132
packageType: sdk
version: 3.1.x
# TODO: find the right way to do this:
# * integrate with scripted build
# * use the correct folders once we're on .NET 6.0 for most things
preCopyNugetPackages:
- task: ArchiveFiles@2
displayName: 'Archive Function App'
inputs:
rootFolderOrFile: 'Solutions/Marain.Claims.Host.Functions/bin/Release/net6.0/'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Release/Marain.Claims.Host.Functions.zip'
replaceExistingArchive: true
- task: ArchiveFiles@2
displayName: 'Archive Deployment Artifacts'
inputs:
rootFolderOrFile: 'Solutions/Marain.Claims.Deployment'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Release/Marain.Claims.Deployment.zip'
replaceExistingArchive: true
netSdkVersion: '6.x'