Skip to content

Commit e61a4a9

Browse files
author
Evans Aboge (from Dev Box)
committed
Switch to prod configs
1 parent dc8e4ff commit e61a4a9

File tree

1 file changed

+118
-115
lines changed

1 file changed

+118
-115
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 118 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variables:
2121
buildPlatform: 'Any CPU'
2222
buildConfiguration: 'Release'
2323
ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)'
24-
REGISTRY: 'msgraphpperegistry.azurecr.io'
24+
REGISTRY: 'msgraphprodregistry.azurecr.io'
2525
IMAGE_NAME: 'public/openapi/hidi'
2626
PREVIEW_BRANCH: 'refs/heads/task/move-to-deploy-stage'
2727

@@ -201,127 +201,130 @@ extends:
201201
content: '*.nupkg'
202202

203203
- stage: deploy
204-
condition: and(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), not(contains(variables['Build.SourceBranch'], '-preview')))
204+
condition: and(or(contains(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])))
205205
dependsOn: build
206206
pool:
207207
name: Azure-Pipelines-1ESPT-ExDShared
208208
os: linux
209209
image: ubuntu-latest
210210
jobs:
211-
# - deployment: deploy_hidi
212-
# templateContext:
213-
# type: releaseJob
214-
# isProduction: true
215-
# inputs:
216-
# - input: pipelineArtifact
217-
# artifactName: Nugets
218-
# targetPath: '$(Pipeline.Workspace)'
219-
# dependsOn: []
220-
# environment: nuget-org
221-
# strategy:
222-
# runOnce:
223-
# deploy:
224-
# pool:
225-
# vmImage: ubuntu-latest
226-
# steps:
227-
# - task: 1ES.PublishNuget@1
228-
# displayName: 'NuGet push'
229-
# inputs:
230-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
231-
# packageParentPath: '$(Pipeline.Workspace)'
232-
# nuGetFeedType: external
233-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
211+
- deployment: deploy_hidi
212+
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
213+
templateContext:
214+
type: releaseJob
215+
isProduction: true
216+
inputs:
217+
- input: pipelineArtifact
218+
artifactName: Nugets
219+
targetPath: '$(Pipeline.Workspace)'
220+
dependsOn: []
221+
environment: nuget-org
222+
strategy:
223+
runOnce:
224+
deploy:
225+
pool:
226+
vmImage: ubuntu-latest
227+
steps:
228+
- task: 1ES.PublishNuget@1
229+
displayName: 'NuGet push'
230+
inputs:
231+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
232+
packageParentPath: '$(Pipeline.Workspace)'
233+
nuGetFeedType: external
234+
publishFeedCredentials: 'OpenAPI Nuget Connection'
234235

235-
# - deployment: deploy_lib
236-
# templateContext:
237-
# type: releaseJob
238-
# isProduction: true
239-
# inputs:
240-
# - input: pipelineArtifact
241-
# artifactName: Nugets
242-
# targetPath: '$(Pipeline.Workspace)'
243-
# dependsOn: []
244-
# environment: nuget-org
245-
# strategy:
246-
# runOnce:
247-
# deploy:
248-
# pool:
249-
# vmImage: ubuntu-latest
250-
# steps:
251-
# - powershell: |
252-
# $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
253-
# foreach($fileName in $fileNames) {
254-
# if(Test-Path $fileName) {
255-
# rm $fileName -Verbose
256-
# }
257-
# }
258-
# displayName: remove other nupkgs to avoid duplication
259-
# - task: 1ES.PublishNuget@1
260-
# displayName: 'NuGet push'
261-
# inputs:
262-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
263-
# packageParentPath: '$(Pipeline.Workspace)'
264-
# nuGetFeedType: external
265-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
236+
- deployment: deploy_lib
237+
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
238+
templateContext:
239+
type: releaseJob
240+
isProduction: true
241+
inputs:
242+
- input: pipelineArtifact
243+
artifactName: Nugets
244+
targetPath: '$(Pipeline.Workspace)'
245+
dependsOn: []
246+
environment: nuget-org
247+
strategy:
248+
runOnce:
249+
deploy:
250+
pool:
251+
vmImage: ubuntu-latest
252+
steps:
253+
- powershell: |
254+
$fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
255+
foreach($fileName in $fileNames) {
256+
if(Test-Path $fileName) {
257+
rm $fileName -Verbose
258+
}
259+
}
260+
displayName: remove other nupkgs to avoid duplication
261+
- task: 1ES.PublishNuget@1
262+
displayName: 'NuGet push'
263+
inputs:
264+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
265+
packageParentPath: '$(Pipeline.Workspace)'
266+
nuGetFeedType: external
267+
publishFeedCredentials: 'OpenAPI Nuget Connection'
266268

267-
# - deployment: deploy_yaml_reader
268-
# templateContext:
269-
# type: releaseJob
270-
# isProduction: true
271-
# inputs:
272-
# - input: pipelineArtifact
273-
# artifactName: Nugets
274-
# targetPath: '$(Pipeline.Workspace)'
275-
# dependsOn: deploy_lib
276-
# environment: nuget-org
277-
# strategy:
278-
# runOnce:
279-
# deploy:
280-
# pool:
281-
# vmImage: ubuntu-latest
282-
# steps:
283-
# - task: 1ES.PublishNuget@1
284-
# displayName: 'NuGet push'
285-
# inputs:
286-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
287-
# packageParentPath: '$(Pipeline.Workspace)'
288-
# nuGetFeedType: external
289-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
269+
- deployment: deploy_yaml_reader
270+
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
271+
templateContext:
272+
type: releaseJob
273+
isProduction: true
274+
inputs:
275+
- input: pipelineArtifact
276+
artifactName: Nugets
277+
targetPath: '$(Pipeline.Workspace)'
278+
dependsOn: deploy_lib
279+
environment: nuget-org
280+
strategy:
281+
runOnce:
282+
deploy:
283+
pool:
284+
vmImage: ubuntu-latest
285+
steps:
286+
- task: 1ES.PublishNuget@1
287+
displayName: 'NuGet push'
288+
inputs:
289+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
290+
packageParentPath: '$(Pipeline.Workspace)'
291+
nuGetFeedType: external
292+
publishFeedCredentials: 'OpenAPI Nuget Connection'
290293

291-
# - deployment: create_github_release
292-
# templateContext:
293-
# type: releaseJob
294-
# isProduction: true
295-
# inputs:
296-
# - input: pipelineArtifact
297-
# artifactName: Nugets
298-
# targetPath: '$(Pipeline.Workspace)'
299-
# dependsOn: []
300-
# environment: kiota-github-releases
301-
# strategy:
302-
# runOnce:
303-
# deploy:
304-
# pool:
305-
# vmImage: ubuntu-latest
306-
# steps:
307-
# - pwsh: |
308-
# $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
309-
# $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
310-
# #Set Variable $artifactName and $artifactVersion
311-
# Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
312-
# echo "$artifactVersion"
313-
# displayName: 'Fetch Artifact Name'
314-
# - task: GitHubRelease@1
315-
# displayName: 'GitHub release (edit)'
316-
# condition: succeededOrFailed()
317-
# inputs:
318-
# gitHubConnection: 'Github-MaggieKimani1'
319-
# action: edit
320-
# tagSource: userSpecifiedTag
321-
# tag: 'v$(artifactVersion)'
322-
# releaseNotesSource: inline
323-
# assets: '$(Pipeline.Workspace)\**\*.exe'
324-
# addChangeLog: false
294+
- deployment: create_github_release
295+
templateContext:
296+
type: releaseJob
297+
isProduction: true
298+
inputs:
299+
- input: pipelineArtifact
300+
artifactName: Nugets
301+
targetPath: '$(Pipeline.Workspace)'
302+
dependsOn: []
303+
environment: kiota-github-releases
304+
strategy:
305+
runOnce:
306+
deploy:
307+
pool:
308+
vmImage: ubuntu-latest
309+
steps:
310+
- pwsh: |
311+
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
312+
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
313+
#Set Variable $artifactName and $artifactVersion
314+
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
315+
echo "$artifactVersion"
316+
displayName: 'Fetch Artifact Name'
317+
- task: GitHubRelease@1
318+
displayName: 'GitHub release (edit)'
319+
condition: succeededOrFailed()
320+
inputs:
321+
gitHubConnection: 'Github-MaggieKimani1'
322+
action: edit
323+
tagSource: userSpecifiedTag
324+
tag: 'v$(artifactVersion)'
325+
releaseNotesSource: inline
326+
assets: '$(Pipeline.Workspace)\**\*.exe'
327+
addChangeLog: false
325328

326329
- deployment: deploy_docker_image
327330
environment: kiota-github-releases
@@ -336,11 +339,11 @@ extends:
336339
- task: AzureCLI@2
337340
displayName: 'Login to Azure Container Registry'
338341
inputs:
339-
azureSubscription: 'ACR Push Test'
342+
azureSubscription: 'ACR Images Push Service Connection'
340343
scriptType: bash
341344
scriptLocation: inlineScript
342345
inlineScript: |
343-
az acr login --name msgraphpperegistry
346+
az acr login --name msgraphprodregistry
344347
345348
- powershell: |
346349
$content = [XML](Get-Content ./Directory.Build.props)

0 commit comments

Comments
 (0)