From e2ace184cbead4c0aad250eb8c5841024ad72cb3 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 7 Jun 2024 16:34:08 +0000 Subject: [PATCH 1/3] refactor(terraform): turn off CI deploys we're going to use GitHub Actions instead --- terraform/.terraform.lock.hcl | 1 + terraform/app_service.tf | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl index 81623cac..b631c360 100644 --- a/terraform/.terraform.lock.hcl +++ b/terraform/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.terraform.io/hashicorp/azurerm" { version = "3.28.0" constraints = ">= 3.0.0, < 4.0.0" hashes = [ + "h1:eQRgBnX2TQ6H4q3sg4WUV1OhN21UdhQYrcyAnyu3U/U=", "h1:jnr5G4X8apGMF63WeMQn6gMGEoM87mI2lwTIj8D36Vg=", "h1:kCnbPOpHvjbMumJ6eeyyJ8r4VkD80bMz3C1OApc1yTI=", "zh:1c01bc8cba03c642d108df034744253ac7e625d7528d77ae57b65809cd08e519", diff --git a/terraform/app_service.tf b/terraform/app_service.tf index a35dfa57..e5c355df 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -41,15 +41,10 @@ resource "azurerm_linux_web_app" "main" { action = "Allow" service_tag = "ApplicationInsightsAvailability" } - - application_stack { - docker_image = "ghcr.io/cal-itp/eligibility-server" - docker_image_tag = local.env_name - } } app_settings = { - "DOCKER_ENABLE_CI" = "true", + "DOCKER_ENABLE_CI" = "false", "DOCKER_REGISTRY_SERVER_URL" = "https://ghcr.io/" "ELIGIBILITY_SERVER_SETTINGS" = "${local.mount_path}/settings.py" # this prevents the filesystem from being obscured by a mount From c94a3665b1c4cca18766d933681753dd4d878868 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 7 Jun 2024 16:34:54 +0000 Subject: [PATCH 2/3] refactor(ci): deploy steps for Azure WebApps one each for MST and SBMTD, using secrets from the GH Actions environment --- .github/workflows/docker-publish.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cbe7659b..7d3d05ca 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -80,6 +80,18 @@ jobs: file: Dockerfile push: true tags: | - ghcr.io/${{ github.repository }}:${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }} - ghcr.io/${{ github.repository }}:${{ github.ref_name }} ghcr.io/${{ github.repository }}:${{ github.sha }} + + - name: Deploy to MST Azure Web App + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ vars.MST_AZURE_WEBAPP_NAME }} + images: ghcr.io/${{ github.repository }}:${{ github.sha }} + publish-profile: ${{ secrets.MST_AZURE_WEBAPP_PUBLISH_PROFILE }} + + - name: Deploy to SBMTD Azure Web App + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ vars.SBMTD_AZURE_WEBAPP_NAME }} + images: ghcr.io/${{ github.repository }}:${{ github.sha }} + publish-profile: ${{ secrets.SBMTD_AZURE_WEBAPP_PUBLISH_PROFILE }} From 367af9b47a1bf7735b769f2048e2f967bf85359f Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 7 Jun 2024 16:40:30 +0000 Subject: [PATCH 3/3] chore(terraform): bump version used in pipeline --- terraform/pipeline/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/pipeline/deploy.yml b/terraform/pipeline/deploy.yml index 4e17d54f..3dfe7ae2 100644 --- a/terraform/pipeline/deploy.yml +++ b/terraform/pipeline/deploy.yml @@ -34,7 +34,7 @@ stages: - task: TerraformInstaller@0 displayName: Install Terraform inputs: - terraformVersion: 1.3.1 + terraformVersion: 1.8.5 # https://github.com/microsoft/azure-pipelines-terraform/tree/main/Tasks/TerraformTask/TerraformTaskV3#readme - task: TerraformTaskV3@3 displayName: Terraform init