From 24f315a9113a0056081897011d27dc45b9d64fa7 Mon Sep 17 00:00:00 2001 From: Jonathan Idland Olsnes <73334350+Jonathanio123@users.noreply.github.com> Date: Thu, 12 Sep 2024 08:38:15 +0200 Subject: [PATCH] chore: Create Summary prod deployment container template (#696) - [ ] New feature - [ ] Bug fix - [ ] High impact **Description of work:** [55224](https://statoil-proview.visualstudio.com/787035c2-8cf2-4d73-a83e-bb0e6d937eec/_workitems/edit/55224) Adds prod deployment template Disables new az functions Fixed minor typo in deployment script **Testing:** - [x] Can be tested - [ ] Automatic tests created / updated - [x] Local tests are passing Summary Api and az functions have been deployed to production with this PR. **Checklist:** - [ ] Considered automated tests - [ ] Considered updating specification / documentation - [x] Considered work items - [x] Considered security - [x] Performed developer testing - [x] Checklist finalized / ready for review --- pipelines/summary-api-pipeline.yml | 2 +- .../deploy-summary-container-app.yml | 23 ++++++++++++++++++ .../Deployment/webapp.template.json | 6 ++--- .../Deployment/disabled-functions.json | 24 +++++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 pipelines/templates/deploy-summary-container-app.yml diff --git a/pipelines/summary-api-pipeline.yml b/pipelines/summary-api-pipeline.yml index e897538dc..afa306cf1 100644 --- a/pipelines/summary-api-pipeline.yml +++ b/pipelines/summary-api-pipeline.yml @@ -243,7 +243,7 @@ stages: action: deploy manifests: $(deploymentManifest) - - template: templates/deploy-container-app.yml + - template: templates/deploy-summary-container-app.yml parameters: azureSubscription: $(subscriptionServiceProd) environment: $(envName) diff --git a/pipelines/templates/deploy-summary-container-app.yml b/pipelines/templates/deploy-summary-container-app.yml new file mode 100644 index 000000000..6329ea6a4 --- /dev/null +++ b/pipelines/templates/deploy-summary-container-app.yml @@ -0,0 +1,23 @@ +parameters: + azureSubscription: 'PROJECT_PORTAL (63b791ae-b2bc-41a1-ac66-806c4e69bffe)' + environment: '' + clientId: '' + imageName: '' + fusionEnvironment: 'fprd' + templateFile: $(Build.SourcesDirectory)src/Fusion.Summary.Api/Deployment/webapp.template.json + +steps: +- checkout: self +- task: AzurePowerShell@5 + displayName: 'Deploy ARM template' + inputs: + azureSubscription: ${{ parameters.azureSubscription }} + ScriptType: FilePath + FailOnStandardError: true + azurePowerShellVersion: 'LatestVersion' + ScriptPath: src/Fusion.Summary.Api/Deployment/deploy-webapp.ps1 + ScriptArguments: > + -environment ${{ parameters.environment }} + -clientId ${{ parameters.clientId }} + -fusionEnvironment ${{ parameters.fusionEnvironment }} + -imageName ${{ parameters.imageName }} diff --git a/src/Fusion.Summary.Api/Deployment/webapp.template.json b/src/Fusion.Summary.Api/Deployment/webapp.template.json index 72aa008b6..c2454335a 100644 --- a/src/Fusion.Summary.Api/Deployment/webapp.template.json +++ b/src/Fusion.Summary.Api/Deployment/webapp.template.json @@ -41,8 +41,8 @@ "fusion-env-name": "[toLower(parameters('fusion-env-name'))]", "location": "[resourceGroup().location]", "api-name": "[concat('fap-summary-api-', variables('env-name'))]", - "keyvault-name": "[concat('kv-fap-summary-', variables('env-name'))]", - "ai-api-name": "[concat('ai-fap-summary-', variables('env-name'))]" + "keyvault-name": "[concat('kv-fap-resources-', variables('env-name'))]", + "ai-api-name": "[concat('ai-fap-resources-', variables('env-name'))]" }, "resources": [ /* API SERVICE */ @@ -142,7 +142,7 @@ ] }, "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('api-name'))]" + "[resourceId('Microsoft.Web/sites', variables('api-name'))]" ] } ] diff --git a/src/Fusion.Summary.Functions/Deployment/disabled-functions.json b/src/Fusion.Summary.Functions/Deployment/disabled-functions.json index 3c70da8da..c07e041ff 100644 --- a/src/Fusion.Summary.Functions/Deployment/disabled-functions.json +++ b/src/Fusion.Summary.Functions/Deployment/disabled-functions.json @@ -2,5 +2,29 @@ { "environment": "pr", "disabledFunctions": [] + }, + { + "environment": "ci", + "disabledFunctions": [ + "weekly-department-recipients-sync", + "weekly-department-summary-sender", + "weekly-department-summary-worker" + ] + }, + { + "environment": "fqa", + "disabledFunctions": [ + "weekly-department-recipients-sync", + "weekly-department-summary-sender", + "weekly-department-summary-worker" + ] + }, + { + "environment": "fprd", + "disabledFunctions": [ + "weekly-department-recipients-sync", + "weekly-department-summary-sender", + "weekly-department-summary-worker" + ] } ]