Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DASD-10821 - YAML Migration - Migrate das-providercommitments #632

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d2b05a6
Adding YAML files
WiseOldOwl Jul 29, 2024
5c3aaf4
Adding variable groups to deployment pipelines
WiseOldOwl Jul 30, 2024
be1cece
Updating the tag reference for building blocks
WiseOldOwl Jul 30, 2024
898bb96
Disabling package scanning to allow for pipeline testing
WiseOldOwl Jul 30, 2024
0a4a88f
changing solution base name
WiseOldOwl Jul 30, 2024
cd1ff1e
changing solution base name
WiseOldOwl Jul 30, 2024
de7c9d9
changing solution base name
WiseOldOwl Jul 30, 2024
a15fa24
master template
WiseOldOwl Jul 31, 2024
2a163fc
updating apiversion of app insights
WiseOldOwl Jul 31, 2024
f278c78
Adding secret to deploy.yml
WiseOldOwl Jul 31, 2024
daf4c5c
updated tag version for building blocks
WiseOldOwl Jul 31, 2024
690e50f
updated config name
WiseOldOwl Jul 31, 2024
4a8b01b
commenting out template blocks to debug
WiseOldOwl Jul 31, 2024
8557e67
commenting out template blocks to debug
WiseOldOwl Jul 31, 2024
9065a94
uncommenting template blocks
WiseOldOwl Jul 31, 2024
1f3415d
fix
WiseOldOwl Aug 1, 2024
ea9a4c2
revert
WiseOldOwl Aug 1, 2024
e30b67b
adding artifact name
WiseOldOwl Aug 1, 2024
da47b92
adding secret to deploy.yml
WiseOldOwl Aug 1, 2024
339ccae
changes
WiseOldOwl Aug 2, 2024
ecc16d3
changes 2
WiseOldOwl Aug 2, 2024
0f573a2
fixed storageconnectionstring output
divesh987 Aug 2, 2024
1d500a4
removed unncessary comma
divesh987 Aug 2, 2024
7f4381b
update to deployment package path
WiseOldOwl Aug 2, 2024
89be8a5
updated variable groups
WiseOldOwl Aug 2, 2024
654ce6a
removing bypass
WiseOldOwl Aug 2, 2024
c65a449
updated azure-pipelines.yml
WiseOldOwl Aug 5, 2024
95a9245
adding in app assignments
WiseOldOwl Aug 6, 2024
6b172ad
Rebase with the master branch
furqanagwan Aug 27, 2024
af976e5
Add in PROD and MO stages into the pipeline
furqanagwan Aug 27, 2024
e2324d2
Merge remote-tracking branch 'origin/master' into DASD_10821_YAML_Mig…
furqanagwan Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 133 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ trigger:
include:
- "master"

variables:
- name: SolutionBaseName
value: SFA.DAS.ProviderCommitments
- name: BuildConfiguration
value: release
- name: BuildPlatform
value: any cpu
- group: RELEASE Management Resources
- group: RELEASE das-providercommitments
- name: Deploy
value: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'PullRequest'))]


resources:
repositories:
- repository: self
Expand All @@ -12,8 +25,127 @@ resources:
name: SkillsFundingAgency/das-platform-building-blocks
ref: refs/tags/2.1.28
endpoint: SkillsFundingAgency
- repository: das-platform-automation
type: github
name: SkillsFundingAgency/das-platform-automation
ref: refs/tags/5.1.8
endpoint: SkillsFundingAgency
pipelines:
- pipeline: das-employer-config
project: Digital Apprenticeship Service
source: das-employer-config
branch: master

stages:
- stage: Build
jobs:
- template: pipeline-templates/job/code-build.yml
- template: pipeline-templates/job/code-build.yml
parameters:
SolutionBaseName: $(SolutionBaseName)
BuildConfiguration: $(BuildConfiguration)

- stage: Deploy_AT
dependsOn: Build
displayName: Deploy to AT
condition: and(succeeded(), eq(variables.Deploy, 'true'))
variables:
- group: DevTest Management Resources
- group: AT DevTest Shared Resources
- group: AT das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: AT
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DAS-DevTest-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-CDS

- stage: Deploy_TEST
dependsOn: Build
displayName: Deploy to TEST
variables:
- group: DevTest Management Resources
- group: TEST DevTest Shared Resources
- group: TEST das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: TEST
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DAS-DevTest-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-CDS

- stage: Deploy_TEST2
dependsOn: Build
displayName: Deploy to TEST2
variables:
- group: DevTest Management Resources
- group: TEST2 DevTest Shared Resources
- group: TEST2 das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: TEST2
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DAS-DevTest-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-CDS

- stage: Deploy_PP
dependsOn: Build
displayName: Deploy to PP
variables:
- group: PreProd Management Resources
- group: PreProd Shared Resources
- group: PreProd das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: PP
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DIG-PreProd-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-FCS

- stage: Deploy_PROD
dependsOn: Build
displayName: Deploy to PROD
variables:
- group: PROD Management Resources
- group: PROD Shared Resources
- group: PROD das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: PROD
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DIG-Prod-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-FCS

- stage: Deploy_MO
dependsOn: Build
displayName: Deploy to MO
variables:
- group: MO Management Resources
- group: MO Shared Resources
- group: MO das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: MO
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-ASM-ModelOffice-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-FCS

- stage: Deploy_DEMO
dependsOn: Build
displayName: Deploy to DEMO
variables:
- group: DevTest Management Resources
- group: DEMO DevTest Shared Resources
- group: DEMO das-providercommitments
jobs:
- template: pipeline-templates/job/deploy.yml
parameters:
Environment: DEMO
SolutionBaseName: $(SolutionBaseName)
ServiceConnection: SFA-DAS-DevTest-ARM
AppRoleAssignmentsServiceConnection: das-app-role-assignments-CDS
18 changes: 16 additions & 2 deletions azure/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
"type": "string",
"defaultValue": "[utcNow()]"
},
"logAnalyticsSubscriptionId": {
"type": "string",
"defaultValue": "[subscription().subscriptionId]"
},
"logAnalyticsWorkspaceName": {
"type": "string"
},
"minimumTlsVersion": {
"type": "string",
"defaultValue": "TLS1_2"
Expand Down Expand Up @@ -274,7 +281,7 @@
]
},
{
"apiVersion": "2017-08-01",
"apiVersion": "2021-04-01",
"name": "[concat(variables('appServiceName'), '-application-insights-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"type": "Microsoft.Resources/deployments",
Expand All @@ -290,6 +297,9 @@
},
"attachedService": {
"value": "[variables('appServiceName')]"
},
"logAnalyticsWorkspaceId": {
"value": "[resourceId(parameters('logAnalyticsSubscriptionId'),parameters('sharedManagementResourceGroup'),'Microsoft.OperationalInsights/workspaces',parameters('logAnalyticsWorkspaceName'))]"
}
}
},
Expand All @@ -306,6 +316,10 @@
"StorageAccountName": {
"type": "string",
"value": "[variables('storageAccountName')]"
},
"StorageConnectionString": {
"type": "string",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId(subscription().subscriptionId, variables('resourceGroupName'), 'Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2022-05-01').keys[0].value, ';EndpointSuffix=', environment().suffixes.storage)]"
}
}
}
}
3 changes: 2 additions & 1 deletion pipeline-templates/job/code-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/publish'
PathtoPublish: '$(build.artifactstagingdirectory)/publish'
artifactName: ${{ parameters.SolutionBaseName }}
59 changes: 59 additions & 0 deletions pipeline-templates/job/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
parameters:
ServiceConnection:
SolutionBaseName:
Environment:
AppRoleAssignmentsServiceConnection:

jobs:
- deployment: DeployWebApp
pool:
name: DAS - Continuous Deployment Agents
environment: ${{ parameters.Environment }}
strategy:
runOnce:
deploy:
steps:
- template: azure-pipelines-templates/deploy/step/wait-azure-devops-deployment.yml@das-platform-building-blocks
parameters:
ServiceConnection: ${{ parameters.ServiceConnection }}
EnvironmentId: $(Environment.Id)
PipelineName: $(Build.DefinitionName)
RunId: $(Build.BuildId)
- template: azure-pipelines-templates/deploy/step/arm-deploy.yml@das-platform-building-blocks
parameters:
ServiceConnection: ${{ parameters.ServiceConnection }}
SubscriptionId: $(SubscriptionId)
Location: $(ResourceGroupLocation)
Environment: ${{ parameters.Environment }}
TemplatePath: $(Pipeline.Workspace)/${{ parameters.SolutionBaseName }}/azure/template.json
ParametersPath: $(Pipeline.Workspace)/${{ parameters.SolutionBaseName }}/azure/template.parameters.json
IsMultiRepoCheckout: true
TemplateSecrets:
LoggingRedisConnectionString: $(LoggingRedisConnectionString)
ConfigurationStorageConnectionString: $(ConfigurationStorageConnectionString)
LoggingRedisKey: $(LoggingRedisKey)
- template: azure-pipelines-templates/deploy/step/get-apim-subscription-key.yml@das-platform-building-blocks
parameters:
ServiceConnection: ${{ parameters.ServiceConnection }}
ApimResourceGroup: $(SharedApimResourceGroup)
ApimName: $(SharedApimName)
SubscriptionId: $(AppServiceName)
PipelineVariableName: ApprovalsApimSubscriptionKey
IsMultiRepoCheckout: true
- template: azure-pipelines-templates/deploy/step/generate-config.yml@das-platform-building-blocks
parameters:
EnvironmentName: $(EnvironmentName)
ServiceConnection: ${{ parameters.ServiceConnection }}
SourcePath: $(Pipeline.Workspace)/das-employer-config/Configuration/das-providercommitments
StorageAccountName: $(ConfigurationStorageAccountName)
StorageAccountResourceGroup: $(SharedEnvResourceGroup)
TargetFileName: '*.schema.json'
TableName: Configuration
ConfigurationSecrets:
ApprovalsApimSubscriptionKey: $(ApprovalsApimSubscriptionKey)
RedisConnectionString: $(RedisConnectionString)
- template: azure-pipelines-templates/deploy/step/app-deploy.yml@das-platform-building-blocks
parameters:
ServiceConnection: ${{ parameters.ServiceConnection }}
AppServiceName: $(AppServiceName)
DeploymentPackagePath: $(Pipeline.Workspace)/${{ parameters.SolutionBaseName }}/${{ parameters.SolutionBaseName }}.Web.zip
Loading