@@ -18,6 +18,10 @@ parameters:
18
18
type : boolean
19
19
default : true
20
20
21
+ variables :
22
+ # Variables used: DncEngInternalBuildPool
23
+ - template : /eng/common/templates-official/variables/pool-providers.yml
24
+
21
25
resources :
22
26
repositories :
23
27
- repository : 1ESPipelineTemplates
@@ -30,81 +34,78 @@ extends:
30
34
parameters :
31
35
sdl :
32
36
sourceAnalysisPool :
33
- name : NetCore1ESPool-Internal
37
+ name : $(DncEngInternalBuildPool)
34
38
image : 1es-windows-2022
35
39
os : windows
36
- pool :
37
- name : NetCore1ESPool-Internal
38
- image : 1es-ubuntu-2204
39
- os : linux
40
40
stages :
41
- - stage : stage
41
+ - stage : Build
42
42
jobs :
43
- - job : jobs
43
+ - job : Create
44
+ pool :
45
+ name : $(DncEngInternalBuildPool)
46
+ image : 1es-ubuntu-2204
47
+ os : linux
44
48
templateContext :
45
49
outputs :
46
50
- output : pipelineArtifact
47
- displayName : ' Publish Test Log and Results'
48
- condition : always()
49
- targetPath : ' $(Build.ArtifactStagingDirectory)'
51
+ targetPath : $(Build.ArtifactStagingDirectory)
50
52
artifactName : Test_LogResults
51
- publishLocation : Container
52
53
- output : pipelineArtifact
53
- displayName : ' Publish Artifacts'
54
54
targetPath : $(System.DefaultWorkingDirectory)/ArtifactsToPublish/
55
- artifactName : outputs
55
+ artifactName : ArtifactsToPublish
56
56
57
57
steps :
58
- - checkout : self
59
- - script : ' $(Build.SourcesDirectory)/build.sh'
58
+ - script : $(Build.SourcesDirectory)/build.sh
59
+ displayName : Build
60
+
60
61
- task : CopyFiles@2
61
62
displayName : Gather Test Log and Results
62
63
inputs :
63
- SourceFolder : ' $(Build.SourcesDirectory)/artifacts'
64
+ SourceFolder : $(Build.SourcesDirectory)/artifacts
64
65
Contents : |
65
66
log/**/*
66
67
TestResults/**/*
67
- TargetFolder : ' $(Build.ArtifactStagingDirectory)'
68
+ TargetFolder : $(Build.ArtifactStagingDirectory)
68
69
continueOnError : true
69
70
condition : always()
70
71
71
72
- task : UseDotNet@2
72
- displayName : ' Use .NET 6.0.100'
73
+ displayName : Use .NET 6.0.100
73
74
inputs :
74
75
packageType : sdk
75
76
version : 6.0.100
76
77
installationPath : $(Build.SourcesDirectory)/.dotnet
77
78
78
79
- task : UseDotNet@2
79
- displayName : ' Use .NET 6.0.300'
80
+ displayName : Use .NET 6.0.300
80
81
inputs :
81
82
packageType : sdk
82
83
version : 6.0.300
83
84
installationPath : $(Build.SourcesDirectory)/.dotnet
84
85
85
86
- task : UseDotNet@2
86
- displayName : ' Use .NET 6.0.400'
87
+ displayName : Use .NET 6.0.400
87
88
inputs :
88
89
packageType : sdk
89
90
version : 6.0.400
90
91
installationPath : $(Build.SourcesDirectory)/.dotnet
91
92
92
93
- task : UseDotNet@2
93
- displayName : ' Use .NET 7.0.100'
94
+ displayName : Use .NET 7.0.100
94
95
inputs :
95
96
packageType : sdk
96
97
version : 7.0.100
97
98
installationPath : $(Build.SourcesDirectory)/.dotnet
98
99
99
100
- task : UseDotNet@2
100
- displayName : ' Use .NET 7.0.200'
101
+ displayName : Use .NET 7.0.200
101
102
inputs :
102
103
packageType : sdk
103
104
version : 7.0.200
104
105
installationPath : $(Build.SourcesDirectory)/.dotnet
105
106
106
107
- task : UseDotNet@2
107
- displayName : ' Use .NET 8.0.200'
108
+ displayName : Use .NET 8.0.200
108
109
inputs :
109
110
packageType : sdk
110
111
version : 8.0.200
@@ -131,51 +132,37 @@ extends:
131
132
displayName: Run Cache Updater
132
133
133
134
- task : CopyFiles@2
135
+ displayName : Copy artifacts to publish
134
136
inputs :
135
137
SourceFolder : $(System.DefaultWorkingDirectory)/NugetDownloadDirectory/SearchCache/
136
138
Contents : |
137
139
NuGetTemplateSearchInfo*.json
138
140
nonTemplatePacks.json
139
141
TargetFolder : $(System.DefaultWorkingDirectory)/ArtifactsToPublish/
140
- - ${{ if eq(parameters.publishToBlob, true) }} :
141
- - script : ' $(Build.SourcesDirectory)/eng/SearchCache/InstallAzureCLI.sh'
142
- displayName : Install Azure CLI
143
-
144
- - bash : az config set extension.use_dynamic_install=yes_without_prompt
145
- displayName : Disable Azure CLI prompts
146
-
147
- - bash : >
148
- az storage azcopy blob upload
149
- -c $(CacheFileStorageContainer)
150
- --account-name $(CacheFileStorageAccount)
151
- -s '$(System.DefaultWorkingDirectory)/ArtifactsToPublish/NuGetTemplateSearchInfoVer2.json'
152
- --sas-token "$(CacheFileStorageSasToken)"
153
- -d NuGetTemplateSearchInfoVer2.json
154
- --verbose
155
- | tee upload.log
156
- && grep ".*Number of Transfers Completed: 1" upload.log || (echo ; echo "Cache file upload failed"; false)
157
- displayName: Upload to blob storage
158
142
159
- - bash : >
160
- az storage azcopy blob upload
161
- -c $(LegacyCacheFileStorageContainer)
162
- --account-name $(LegacyCacheFileStorageAccount)
163
- -s '$(System.DefaultWorkingDirectory)/ArtifactsToPublish/NuGetTemplateSearchInfo.json'
164
- --sas-token "$(LegacyCacheFileStorageSasToken)"
165
- -d NuGetTemplateSearchInfo.json
166
- --verbose
167
- | tee upload-legacy.log
168
- && grep ".*Number of Transfers Completed: 1" upload-legacy.log || (echo ; echo "Legacy cache file upload failed"; false)
169
- displayName: Upload legacy file to blob storage
170
-
171
- - bash : >
172
- az storage azcopy blob upload
173
- -c $(NonTemplatePacksFileStorageContainer)
174
- --account-name $(NonTemplatePacksFileStorageAccount)
175
- -s '$(System.DefaultWorkingDirectory)/ArtifactsToPublish/nonTemplatePacks.json'
176
- --sas-token "$(NonTemplatePacksFileStorageSasToken)"
177
- -d nonTemplatePacks.json
178
- --verbose
179
- | tee upload-non-template-packs.log
180
- && grep ".*Number of Transfers Completed: 1" upload-non-template-packs.log || (echo ; echo "Legacy cache file upload failed"; false)
181
- displayName: Upload non template packages file to blob storage
143
+ - ${{ if eq(parameters.publishToBlob, true) }} :
144
+ # An entirely separate job is required to run AzureFileCopy@6, which is a Windows-only task.
145
+ # If the Create job was rewritten to use PowerShell instead of Bash, Create and Publish could be combined into a single Windows job.
146
+ - job : Publish
147
+ dependsOn : Create
148
+ pool :
149
+ name : $(DncEngInternalBuildPool)
150
+ image : 1es-windows-2022
151
+ os : windows
152
+ templateContext :
153
+ inputs :
154
+ - input : pipelineArtifact
155
+ targetPath : $(System.DefaultWorkingDirectory)/ArtifactsToPublish/
156
+ artifactName : ArtifactsToPublish
157
+
158
+ steps :
159
+ - task : AzureFileCopy@6
160
+ displayName : Upload to blob storage
161
+ inputs :
162
+ SourcePath : $(System.DefaultWorkingDirectory)/ArtifactsToPublish/*.json
163
+ # Service connection: https://dnceng.visualstudio.com/internal/_settings/adminservices?resourceId=010b0bdc-9487-484f-af2d-ca3ae3235b84
164
+ azureSubscription : DOTNET-Templating - PME
165
+ Destination : AzureBlob
166
+ # These variables are defined in the pipeline's Variables UI.
167
+ storage : $(CacheFileStorageAccount)
168
+ ContainerName : $(CacheFileStorageContainer)
0 commit comments