Skip to content

Commit 2598dad

Browse files
author
Evans Aboge (from Dev Box)
committed
Cleanup and restore right variables
1 parent a68e5e5 commit 2598dad

File tree

1 file changed

+119
-123
lines changed

1 file changed

+119
-123
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 119 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ trigger:
77
include:
88
- main
99
- support/v1
10-
- task/move-to-deploy-stage
1110
tags:
1211
include:
1312
- 'v*'
@@ -16,15 +15,14 @@ pr:
1615
include:
1716
- main
1817
- support/v1
19-
- task/move-to-deploy-stage
2018

2119
variables:
2220
buildPlatform: 'Any CPU'
2321
buildConfiguration: 'Release'
2422
ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)'
25-
REGISTRY: 'msgraphpperegistry.azurecr.io'
23+
REGISTRY: 'msgraphprodregistry.azurecr.io'
2624
IMAGE_NAME: 'public/openapi/hidi'
27-
PREVIEW_BRANCH: 'refs/heads/task/move-to-deploy-stage'
25+
PREVIEW_BRANCH: 'refs/heads/main'
2826

2927
resources:
3028
repositories:
@@ -225,126 +223,126 @@ extends:
225223
os: linux
226224
image: ubuntu-latest
227225
jobs:
228-
# - deployment: deploy_hidi
229-
# condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
230-
# templateContext:
231-
# type: releaseJob
232-
# isProduction: true
233-
# inputs:
234-
# - input: pipelineArtifact
235-
# artifactName: Nugets
236-
# targetPath: '$(Pipeline.Workspace)'
237-
# dependsOn: []
238-
# environment: nuget-org
239-
# strategy:
240-
# runOnce:
241-
# deploy:
242-
# pool:
243-
# vmImage: ubuntu-latest
244-
# steps:
245-
# - task: 1ES.PublishNuget@1
246-
# displayName: 'NuGet push'
247-
# inputs:
248-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
249-
# packageParentPath: '$(Pipeline.Workspace)'
250-
# nuGetFeedType: external
251-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
226+
- deployment: deploy_hidi
227+
condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
228+
templateContext:
229+
type: releaseJob
230+
isProduction: true
231+
inputs:
232+
- input: pipelineArtifact
233+
artifactName: Nugets
234+
targetPath: '$(Pipeline.Workspace)'
235+
dependsOn: []
236+
environment: nuget-org
237+
strategy:
238+
runOnce:
239+
deploy:
240+
pool:
241+
vmImage: ubuntu-latest
242+
steps:
243+
- task: 1ES.PublishNuget@1
244+
displayName: 'NuGet push'
245+
inputs:
246+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
247+
packageParentPath: '$(Pipeline.Workspace)'
248+
nuGetFeedType: external
249+
publishFeedCredentials: 'OpenAPI Nuget Connection'
252250

253-
# - deployment: deploy_lib
254-
# condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
255-
# templateContext:
256-
# type: releaseJob
257-
# isProduction: true
258-
# inputs:
259-
# - input: pipelineArtifact
260-
# artifactName: Nugets
261-
# targetPath: '$(Pipeline.Workspace)'
262-
# dependsOn: []
263-
# environment: nuget-org
264-
# strategy:
265-
# runOnce:
266-
# deploy:
267-
# pool:
268-
# vmImage: ubuntu-latest
269-
# steps:
270-
# - powershell: |
271-
# $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
272-
# foreach($fileName in $fileNames) {
273-
# if(Test-Path $fileName) {
274-
# rm $fileName -Verbose
275-
# }
276-
# }
277-
# displayName: remove other nupkgs to avoid duplication
278-
# - task: 1ES.PublishNuget@1
279-
# displayName: 'NuGet push'
280-
# inputs:
281-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
282-
# packageParentPath: '$(Pipeline.Workspace)'
283-
# nuGetFeedType: external
284-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
251+
- deployment: deploy_lib
252+
condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
253+
templateContext:
254+
type: releaseJob
255+
isProduction: true
256+
inputs:
257+
- input: pipelineArtifact
258+
artifactName: Nugets
259+
targetPath: '$(Pipeline.Workspace)'
260+
dependsOn: []
261+
environment: nuget-org
262+
strategy:
263+
runOnce:
264+
deploy:
265+
pool:
266+
vmImage: ubuntu-latest
267+
steps:
268+
- powershell: |
269+
$fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
270+
foreach($fileName in $fileNames) {
271+
if(Test-Path $fileName) {
272+
rm $fileName -Verbose
273+
}
274+
}
275+
displayName: remove other nupkgs to avoid duplication
276+
- task: 1ES.PublishNuget@1
277+
displayName: 'NuGet push'
278+
inputs:
279+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
280+
packageParentPath: '$(Pipeline.Workspace)'
281+
nuGetFeedType: external
282+
publishFeedCredentials: 'OpenAPI Nuget Connection'
285283

286-
# - deployment: deploy_yaml_reader
287-
# condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
288-
# templateContext:
289-
# type: releaseJob
290-
# isProduction: true
291-
# inputs:
292-
# - input: pipelineArtifact
293-
# artifactName: Nugets
294-
# targetPath: '$(Pipeline.Workspace)'
295-
# dependsOn: deploy_lib
296-
# environment: nuget-org
297-
# strategy:
298-
# runOnce:
299-
# deploy:
300-
# pool:
301-
# vmImage: ubuntu-latest
302-
# steps:
303-
# - task: 1ES.PublishNuget@1
304-
# displayName: 'NuGet push'
305-
# inputs:
306-
# packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
307-
# packageParentPath: '$(Pipeline.Workspace)'
308-
# nuGetFeedType: external
309-
# publishFeedCredentials: 'OpenAPI Nuget Connection'
284+
- deployment: deploy_yaml_reader
285+
condition: and(contains(variables['build.SourceBranch'], 'refs/tags/v'), succeeded())
286+
templateContext:
287+
type: releaseJob
288+
isProduction: true
289+
inputs:
290+
- input: pipelineArtifact
291+
artifactName: Nugets
292+
targetPath: '$(Pipeline.Workspace)'
293+
dependsOn: deploy_lib
294+
environment: nuget-org
295+
strategy:
296+
runOnce:
297+
deploy:
298+
pool:
299+
vmImage: ubuntu-latest
300+
steps:
301+
- task: 1ES.PublishNuget@1
302+
displayName: 'NuGet push'
303+
inputs:
304+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
305+
packageParentPath: '$(Pipeline.Workspace)'
306+
nuGetFeedType: external
307+
publishFeedCredentials: 'OpenAPI Nuget Connection'
310308

311-
# - deployment: create_github_release
312-
# templateContext:
313-
# type: releaseJob
314-
# isProduction: true
315-
# inputs:
316-
# - input: pipelineArtifact
317-
# artifactName: Nugets
318-
# targetPath: '$(Pipeline.Workspace)'
319-
# dependsOn: []
320-
# environment: kiota-github-releases
321-
# strategy:
322-
# runOnce:
323-
# deploy:
324-
# pool:
325-
# vmImage: ubuntu-latest
326-
# steps:
327-
# - pwsh: |
328-
# $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
329-
# $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
330-
# #Set Variable $artifactName and $artifactVersion
331-
# Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
332-
# echo "$artifactVersion"
333-
# displayName: 'Fetch Artifact Name'
334-
# - task: GitHubRelease@1
335-
# displayName: 'GitHub release (edit)'
336-
# condition: succeededOrFailed()
337-
# inputs:
338-
# gitHubConnection: 'Github-MaggieKimani1'
339-
# action: edit
340-
# tagSource: userSpecifiedTag
341-
# tag: 'v$(artifactVersion)'
342-
# releaseNotesSource: inline
343-
# assets: '$(Pipeline.Workspace)\**\*.exe'
344-
# addChangeLog: false
309+
- deployment: create_github_release
310+
templateContext:
311+
type: releaseJob
312+
isProduction: true
313+
inputs:
314+
- input: pipelineArtifact
315+
artifactName: Nugets
316+
targetPath: '$(Pipeline.Workspace)'
317+
dependsOn: []
318+
environment: kiota-github-releases
319+
strategy:
320+
runOnce:
321+
deploy:
322+
pool:
323+
vmImage: ubuntu-latest
324+
steps:
325+
- pwsh: |
326+
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
327+
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
328+
#Set Variable $artifactName and $artifactVersion
329+
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
330+
echo "$artifactVersion"
331+
displayName: 'Fetch Artifact Name'
332+
- task: GitHubRelease@1
333+
displayName: 'GitHub release (edit)'
334+
condition: succeededOrFailed()
335+
inputs:
336+
gitHubConnection: 'Github-MaggieKimani1'
337+
action: edit
338+
tagSource: userSpecifiedTag
339+
tag: 'v$(artifactVersion)'
340+
releaseNotesSource: inline
341+
assets: '$(Pipeline.Workspace)\**\*.exe'
342+
addChangeLog: false
345343

346344
- deployment: deploy_docker_image
347-
environment: kiota-docker-images-releases
345+
environment: docker-images-deploy
348346
templateContext:
349347
type: releaseJob
350348
isProduction: true
@@ -358,16 +356,14 @@ extends:
358356
pool:
359357
vmImage: 'ubuntu-latest'
360358
steps:
361-
# - checkout: self
362-
363359
- task: AzureCLI@2
364360
displayName: 'Login to Azure Container Registry'
365361
inputs:
366-
azureSubscription: 'ACR Push Test'
362+
azureSubscription: 'ACR Images Push Service Connection'
367363
scriptType: bash
368364
scriptLocation: inlineScript
369365
inlineScript: |
370-
az acr login --name msgraphpperegistry
366+
az acr login --name msgraphprodregistry
371367
372368
- powershell: |
373369
$content = [XML](Get-Content $(Pipeline.Workspace)/Directory.Build.props)

0 commit comments

Comments
 (0)