Skip to content

Commit cfabd2a

Browse files
Client Encryption: Fixes Encryption Release Pipeline (#5234)
# Pull Request Template ## Description Adds fix for Cosmos Encryption release pipeline. ### Encryption Pipeline: ![image](https://github.com/user-attachments/assets/3ffa238b-2b32-49eb-9fd5-132a82b09818) ### Encryption Custom Pipeline: ![image](https://github.com/user-attachments/assets/feaef5df-2d83-4578-b5aa-bbbc72c7c972) ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) ## Closing issues To automatically close an issue: closes #IssueNumber
1 parent f20c804 commit cfabd2a

8 files changed

+382
-155
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
trigger: none
2+
3+
pr: none
4+
5+
variables:
6+
ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal '
7+
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
8+
BuildConfiguration: Release
9+
Packaging.EnableSBOMSigning: true
10+
11+
stages:
12+
- stage:
13+
displayName: Encryption Custom Release Gates
14+
jobs:
15+
- template: templates/static-tools-encryption-custom.yml
16+
parameters:
17+
BuildConfiguration: '${{ variables.BuildConfiguration }}'
18+
VmImage: '${{ variables.VmImage }}'
19+
20+
- stage:
21+
displayName: Build, Pack and Publish
22+
jobs:
23+
- template: templates/encryption-custom-nuget-pack.yml
24+
parameters:
25+
BuildConfiguration: Release
26+
VmImage: '${{ variables.VmImage }}'
27+
ReleasePackage: true
28+
OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos.Encryption.Custom'
29+
BlobVersion: $(BlobVersion)

azure-pipelines-encryption-custom.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
trigger: none
2+
3+
pr: none
4+
5+
variables:
6+
ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal '
7+
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
8+
BuildConfiguration: Release
9+
Packaging.EnableSBOMSigning: true
10+
11+
stages:
12+
- stage:
13+
displayName: Encryption Release Gates
14+
jobs:
15+
- template: templates/static-tools-encryption.yml
16+
parameters:
17+
BuildConfiguration: '${{ variables.BuildConfiguration }}'
18+
VmImage: '${{ variables.VmImage }}'
19+
20+
- stage:
21+
displayName: Build, Pack and Publish
22+
jobs:
23+
- template: templates/encryption-nuget-pack.yml
24+
parameters:
25+
BuildConfiguration: Release
26+
VmImage: '${{ variables.VmImage }}'
27+
ReleasePackage: true
28+
OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos.Encryption'
29+
BlobVersion: $(BlobVersion)

azure-pipelines-encryption.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# File: templates/encryption-nuget-pack.yml
2+
3+
parameters:
4+
- name: BuildConfiguration
5+
type: string
6+
default: ''
7+
- name: Arguments
8+
type: string
9+
default: ''
10+
- name: VmImage
11+
type: string
12+
default: ''
13+
- name: OutputPath
14+
type: string
15+
default: ''
16+
- name: BlobVersion
17+
type: string
18+
default: ''
19+
- name: ReleasePackage
20+
type: boolean
21+
default: false
22+
- name: CleanupFolder
23+
type: boolean
24+
default: false
25+
26+
jobs:
27+
- job: GenerateNugetPackages
28+
displayName: Generate Nuget packages
29+
pool:
30+
name: 'OneES'
31+
32+
steps:
33+
- task: DotNetCoreCLI@2
34+
displayName: Build Microsoft.Azure.Cosmos.Encryption.Custom
35+
inputs:
36+
command: build
37+
configuration: $(BuildConfiguration)
38+
nugetConfigPath: NuGet.config
39+
projects: Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj
40+
arguments: --configuration ${{ parameters.BuildConfiguration }} -p:Optimize=true ${{ parameters.Arguments }}
41+
versioningScheme: OFF
42+
43+
- task: DotNetCoreCLI@2
44+
displayName: 'Create Encryption Custom NuGet Package'
45+
inputs:
46+
command: custom
47+
projects: 'Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj'
48+
custom: pack
49+
arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"'
50+
51+
- ${{ if eq(parameters.ReleasePackage, true) }}:
52+
- task: DotNetCoreCLI@2
53+
displayName: 'Create Encryption Custom NuGet Symbols Package'
54+
inputs:
55+
command: custom
56+
projects: 'Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj'
57+
custom: pack
58+
arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build --include-symbols /p:SymbolPackageFormat=snupkg ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"'
59+
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
60+
inputs:
61+
BuildDropPath: '$(Build.ArtifactStagingDirectory)\bin\AnyCPU\$(BuildConfiguration)\Microsoft.Azure.Cosmos.Encryption.Custom'
62+
63+
- ${{ if ne(parameters.BlobVersion, '') }}:
64+
- task: AzureFileCopy@6
65+
displayName: 'Copy Artifacts to Azure SDK Release blob storage'
66+
condition: succeeded()
67+
inputs:
68+
SourcePath: '$(Build.ArtifactStagingDirectory)\bin\AnyCPU\$(BuildConfiguration)\Microsoft.Azure.Cosmos.Encryption.Custom/**'
69+
azureSubscription: azuresdkpartnerdrops
70+
Destination: AzureBlob
71+
storage: azuresdkpartnerdrops
72+
ContainerName: 'drops'
73+
BlobPrefix: 'cosmosdb/csharp/encryption.custom/$(BlobVersion)'
74+
CleanTargetBeforeCopy: ${{ parameters.CleanupFolder }}
75+
76+
- task: PublishBuildArtifacts@1
77+
displayName: 'Publish Artifacts: Microsoft.Azure.Cosmos.Encryption.Custom'
78+
inputs:
79+
artifactName: Microsoft.Azure.Cosmos.Encryption.Custom
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# File: templates/encryption-nuget-pack.yml
2+
3+
parameters:
4+
- name: BuildConfiguration
5+
type: string
6+
default: ''
7+
- name: Arguments
8+
type: string
9+
default: ''
10+
- name: VmImage
11+
type: string
12+
default: ''
13+
- name: OutputPath
14+
type: string
15+
default: ''
16+
- name: BlobVersion
17+
type: string
18+
default: ''
19+
- name: ReleasePackage
20+
type: boolean
21+
default: false
22+
- name: CleanupFolder
23+
type: boolean
24+
default: false
25+
26+
jobs:
27+
- job: GenerateNugetPackages
28+
displayName: Generate Nuget packages
29+
pool:
30+
name: 'OneES'
31+
32+
steps:
33+
- task: DotNetCoreCLI@2
34+
displayName: Build Microsoft.Azure.Cosmos.Encryption
35+
inputs:
36+
command: build
37+
configuration: $(BuildConfiguration)
38+
nugetConfigPath: NuGet.config
39+
projects: Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj
40+
arguments: --configuration ${{ parameters.BuildConfiguration }} -p:Optimize=true ${{ parameters.Arguments }}
41+
versioningScheme: OFF
42+
43+
- task: DotNetCoreCLI@2
44+
displayName: 'Create Encryption NuGet Package'
45+
inputs:
46+
command: custom
47+
projects: 'Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj'
48+
custom: pack
49+
arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"'
50+
51+
- ${{ if eq(parameters.ReleasePackage, true) }}:
52+
- task: DotNetCoreCLI@2
53+
displayName: 'Create Encryption NuGet Symbols Package'
54+
inputs:
55+
command: custom
56+
projects: 'Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj'
57+
custom: pack
58+
arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build --include-symbols /p:SymbolPackageFormat=snupkg ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"'
59+
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
60+
inputs:
61+
BuildDropPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos.Encryption'
62+
63+
- ${{ if ne(parameters.BlobVersion, '') }}:
64+
- task: AzureFileCopy@6
65+
displayName: 'Copy Artifacts to Azure SDK Release blob storage'
66+
condition: succeeded()
67+
inputs:
68+
SourcePath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos.Encryption/**'
69+
azureSubscription: azuresdkpartnerdrops
70+
Destination: AzureBlob
71+
storage: azuresdkpartnerdrops
72+
ContainerName: 'drops'
73+
BlobPrefix: 'cosmosdb/csharp/encryption/$(BlobVersion)'
74+
CleanTargetBeforeCopy: ${{ parameters.CleanupFolder }}
75+
76+
- task: PublishBuildArtifacts@1
77+
displayName: 'Publish Artifacts: Microsoft.Azure.Cosmos.Encryption'
78+
inputs:
79+
artifactName: Microsoft.Azure.Cosmos.Encryption

0 commit comments

Comments
 (0)