-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
123 lines (119 loc) · 7.16 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
trigger:
branches:
include:
- master
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=AzureServicesAuthConnectionString]$Env:ENDJIN_AZURESERVICESAUTHCONNECTIONSTRING"
Write-Host "##vso[task.setvariable variable=APPINSIGHTS_INSTRUMENTATIONKEY]$Env:ENDJIN_APPINSIGHTSINSTRUMENTATIONKEY"
Write-Host "##vso[task.setvariable variable=AzureWebJobsStorage]$Env:ENDJIN_AZURESTORAGECONNECTIONSTRING"
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=Operations__ControlServiceBaseUrl]$Env:ENDJIN_MARAINOPERATIONSCONTROLBASEURL"
Write-Host "##vso[task.setvariable variable=Operations__ResourceIdForMsiAuthentication]$Env:ENDJIN_MARAINOPERATIONSCONTROLRESOURCEID"
Write-Host "##vso[task.setvariable variable=TestBlobStorageConfiguration__ConnectionStringPlainText]$Env:ENDJIN_AZURESTORAGECONNECTIONSTRING"
Write-Host "##vso[task.setvariable variable=TestStorageConfiguration__ConnectionStringPlainText]$Env:ENDJIN_AZURESTORAGECONNECTIONSTRING"
Write-Host "##vso[task.setvariable variable=TestCosmosConfiguration__AccountUri]$Env:ENDJIN_COSMOSDBACCOUNTURI"
Write-Host "##vso[task.setvariable variable=TestCosmosConfiguration__AccessKeyInKeyVault__SecretName]$Env:ENDJIN_COSMOSDBKEYSECRETNAME"
Write-Host "##vso[task.setvariable variable=TestCosmosConfiguration__AccessKeyInKeyVault__VaultName]$Env:ENDJIN_KEYVAULTNAME"
Write-Host "##vso[task.setvariable variable=TestCosmosConfiguration__DisableTenantIdPrefix]true"
Write-Host "##vso[task.setvariable variable=TestSqlConfiguration__ConnectionStringInKeyVault__SecretName]$Env:ENDJIN_SQLDBCONNECTIONSTRINGSECRETNAME"
Write-Host "##vso[task.setvariable variable=TestSqlConfiguration__ConnectionStringInKeyVault__VaultName]$Env:ENDJIN_KEYVAULTNAME"
Write-Host "##vso[task.setvariable variable=MarainServiceConfiguration:ServiceDisplayName]$Env:ENDJIN_MARAINWORKFLOWSERVICEDISPLAYNAME"
Write-Host "##vso[task.setvariable variable=MarainServiceConfiguration:ServiceTenantId]$Env:ENDJIN_MARAINWORKFLOWSERVICETENANTID"
Write-Host "##vso[task.setvariable variable=LeasingStorageAccountConnectionString]$Env:ENDJIN_AZURESTORAGECONNECTIONSTRING"
Write-Host "##vso[task.setvariable variable=TenantedWorkflowEngineFactoryConfiguration__CloudEventBaseSourceName]azuresubscriptionid.workflowresourcegroupname"
displayName: 'Set Custom Environment Variables'
env:
ENDJIN_AZURESERVICESAUTHCONNECTIONSTRING: $(Endjin_AzureServicesAuthConnectionString)
ENDJIN_APPINSIGHTSINSTRUMENTATIONKEY: $(Endjin_AppInsightsInstrumentationKey)
ENDJIN_AZURESTORAGECONNECTIONSTRING: $(Endjin_AzureStorageConnectionString)
ENDJIN_MARAINTENANCYBASEURL: $(Endjin_MarainTenancyBaseUrl)
ENDJIN_MARAINTENANCYRESOURCEIDFORMSIAUTHENTICATION: $(Endjin_MarainTenancyResourceIdForMsiAuthentication)
ENDJIN_MARAINOPERATIONSCONTROLBASEURL: $(Endjin_MarainOperationsControlBaseUrl)
ENDJIN_MARAINOPERATIONSCONTROLRESOURCEID: $(Endjin_MarainOperationsControlResourceIdForMsiAuthentication)
ENDJIN_COSMOSDBACCOUNTURI: $(Endjin_CosmosDbAccountUri)
ENDJIN_COSMOSACCOUNTKEYSECRETNAME: $(Endjin_CosmosDbKeySecretName)
ENDJIN_KEYVAULTNAME: $(Endjin_KeyVaultName)
ENDJIN_SQLDBDATABASE: $(Endjin_SqlDbDatabase)
ENDJIN_SQLDBCONNECTIONSTRINGSECRETNAME: $(Endjin_SqlDbConnectionStringSecretName)
ENDJIN_MARAINWORKFLOWSERVICEDISPLAYNAME: $(Endjin_MarainWorkflowServiceDisplayName)
ENDJIN_MARAINWORKFLOWSERVICETENANTID: $(Endjin_MarainWorkflowServiceTenantId)
- 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: MSBuild@1
displayName: 'Build SQL DACPAC'
inputs:
solution: '**/Marain.Workflow.SqlDatabase.sln'
configuration: $(BuildConfiguration)
preCopyNugetPackages:
- task: ArchiveFiles@2
displayName: 'Archive Message Ingestion Host Function App'
inputs:
rootFolderOrFile: 'Solutions/Marain.Workflow.Api.MessageProcessingHost/bin/Release/net6.0/'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Release/Marain.Workflow.Api.MessageProcessingHost.zip'
replaceExistingArchive: true
- task: ArchiveFiles@2
displayName: 'Archive Engine Host Function App'
inputs:
rootFolderOrFile: 'Solutions/Marain.Workflow.Api.EngineHost/bin/Release/net6.0/'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Release/Marain.Workflow.Api.EngineHost.zip'
replaceExistingArchive: true
- task: ArchiveFiles@2
displayName: 'Archive Deployment Artifacts'
inputs:
rootFolderOrFile: 'Solutions/Marain.Workflow.Deployment'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Release/Marain.Workflow.Deployment.zip'
replaceExistingArchive: true
- task: CopyFiles@2
displayName: 'Copy DACPACs To Release Folder'
inputs:
Contents: |
**/bin/$(BuildConfiguration)/*.dacpac
TargetFolder: '$(Build.ArtifactStagingDirectory)/Release/DACPACs'
flattenFolders: true
netSdkVersion: '6.x'