Skip to content

Commit

Permalink
chore: migrate releases to governed templates (#3377)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman authored Oct 3, 2024
1 parent d87b87a commit 6559844
Showing 1 changed file with 97 additions and 2 deletions.
99 changes: 97 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extends:
- ES365AIMigrationTooling

stages:
- stage: stage
- stage: BuildTestAndPublish
jobs:
- job: One
displayName: "Build and test validation"
Expand Down Expand Up @@ -178,7 +178,6 @@ extends:
- job: Three
displayName: "Publish artifacts"
dependsOn: One
condition: and(succeeded(), or(eq(variables['isMaster'], 'true'), eq(variables['isDev'], 'true')))
steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -287,3 +286,99 @@ extends:
directory: 'microsoft-graph-explorer-v4'
repoName: ReleasePipelines
dependsOn: ['Three']

- stage: DeployStaging
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/dev'), succeeded())
dependsOn: BuildTestAndPublish
jobs:
- deployment: staging
templateContext:
type: releaseJob
isProduction: false
inputs:
- input: pipelineArtifact
artifactName: drop
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
environment: graphexplorer-staging
strategy:
runOnce:
deploy:
steps:
- task: AzureWebApp@1
displayName: 'Deploy to graphTryIt-staging copy'
inputs:
azureSubscription: 'Federated GE Managed Identity Connection'
appType: webApp
appName: 'graphTryIt-staging'
package: '$(Build.ArtifactStagingDirectory)/drop'

- task: AzureFileCopy@6
displayName: 'Deploy to dev storage -tst'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/drop'
azureSubscription: 'Federated GE Managed Identity Connection'
Destination: AzureBlob
storage: graphexplorerstorage
ContainerName: deployments
BlobPrefix: 'vendor/bower_components/explorer-v2/build'

- stage: DeployProduction
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
dependsOn: BuildTestAndPublish
jobs:
- deployment: production
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: drop
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
environment: graphexplorer-production
strategy:
runOnce:
deploy:
steps:
- task: AzureWebApp@1
displayName: 'Azure Web App Deploy: graphTryIt'
inputs:
azureSubscription: 'Federated GE Managed Identity Connection'
appType: webApp
appName: graphTryIt
package: '$(Build.ArtifactStagingDirectory)/drop'

- task: AzureFileCopy@6
displayName: 'Deploy to portal - staging'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/drop/*'
azureSubscription: 'Federated GE-Portals Managed Identity Connection'
Destination: AzureBlob
storage: graphstagingblobstorage
ContainerName: staging
BlobPrefix: 'vendor/bower_components/explorer$(Build.BuildNumber)/build'

- task: AzureFileCopy@6
displayName: 'Deploy to portal - production'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/drop/*'
azureSubscription: 'Federated GE-Portals Managed Identity Connection'
Destination: AzureBlob
storage: graphprodblobstorage
ContainerName: prod
BlobPrefix: 'vendor/bower_components/explorer$(Build.BuildNumber)/build'

- task: ArchiveFiles@2
displayName: 'Archive built assets'
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/drop/'
archiveFile: '$(Build.ArtifactStagingDirectory)/graph-explorer-$(Build.BuildNumber)-$(Build.BuildId).zip'

- task: GitHubRelease@1
displayName: 'GitHub release (v$(Build.BuildNumber)-$(Build.BuildId))'
inputs:
gitHubConnection: 'GitHub - thewahome'
action: edit
tag: 'v$(Build.BuildNumber)'
title: 'Graph Explorer - v$(Build.BuildNumber)'
assets: '$(Build.ArtifactStagingDirectory)/*.zip'
changeLogType: issueBased

0 comments on commit 6559844

Please sign in to comment.