Skip to content

Commit

Permalink
deploy to middleware with CORS change
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Dec 13, 2024
1 parent 2f2e622 commit 0a54838
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build-deploy-ocr.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Create, publish, deploy a OCR API image

on:
# push:
# branches: test-deploy-middleware
workflow_dispatch:
inputs:
deploy-env:
description: 'The environment to deploy to'
required: true
type: choice
options:
- dev
- demo
ocr-docker-tag:
description: 'This is optional if you would like to deploy an already published OCR-API image'
required: false
push:
branches: test-deploy-middleware
# workflow_dispatch:
# inputs:
# deploy-env:
# description: 'The environment to deploy to'
# required: true
# type: choice
# options:
# - dev
# - demo
# ocr-docker-tag:
# description: 'This is optional if you would like to deploy an already published OCR-API image'
# required: false

permissions:
contents: read
Expand All @@ -37,7 +37,7 @@ jobs:
shell: bash
id: set_tag
run: |
USER_INPUT="fa1b599d864865dda07d564a113928f48eaaf163"
USER_INPUT=""
echo "docker_tag=$(
#this gives a new sha as default if dispatch input is empty
echo ${USER_INPUT:-"${{ github.sha }}"}
Expand All @@ -63,7 +63,7 @@ jobs:
deploy-ocr:
name: Deploy OCR
runs-on: ubuntu-latest
environment: dev
environment: demo
needs: [build-publish-ocr]
steps:
- uses: actions/checkout@v4
Expand All @@ -76,7 +76,7 @@ jobs:
- name: Deploy OCR-API
uses: ./.github/actions/deploy-api
with:
deploy-env: dev
deploy-env: demo
docker-tag: ${{ needs.build-publish-ocr.outputs.docker_tag }}
docker-registry: ghcr.io
api-name: middleware
5 changes: 2 additions & 3 deletions ops/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module "middleware_api" {
PORT = "8080"
SSL_MODE = "require"
POSTGRES_HOST = module.database.postgres_fqdn
POSTGRES_DB = module.database.postgres_db_name
POSTGRES_DB = "${module.database.postgres_db_name}-db"
POSTGRES_USER = module.database.postgres_user
POSTGRES_PASSWORD = module.vault.postgres_password
WEBSITES_CONTAINER_START_TIME_LIMIT = 400
Expand Down Expand Up @@ -110,7 +110,7 @@ module "ocr_api" {
vnet = module.networking.network_name
sku_name = var.sku_name
https_only = true
depends_on = [module.networking.ocrsubnet_id, module.networking.middlewaresubnet_id]
depends_on = [module.networking.ocrsubnet_id, module.networking.lbsubnet_id]
}

module "ocr_autoscale" {
Expand Down Expand Up @@ -142,7 +142,6 @@ module "vault" {
name = var.name
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
env = local.environment
tenant_id = var.tenant_id
client_id = var.client_id
object_id = module.middleware_api.webapp_id
Expand Down
6 changes: 0 additions & 6 deletions ops/terraform/modules/security/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ resource "azurerm_network_security_group" "web-nsg" {
# }
}

resource "azurerm_subnet_network_security_group_association" "web-nsg-subnet" {
depends_on = [azurerm_network_security_rule.ag_nsg_rule_inbound]
subnet_id = var.lb_subnet_id
network_security_group_id = azurerm_network_security_group.web-nsg.id
}

locals {
ag_inbound_ports_map = {
"100" : "80", # If the key starts with a number, you must use the colon syntax ":" instead of "="
Expand Down
4 changes: 1 addition & 3 deletions ops/terraform/modules/vault/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ variable "postgres_server_id" {
variable "resource_group_name" {}
variable "subscription_id" {}
variable "service_plan_id" {}
variable "tenant_id" {}
variable "env" {
}
variable "tenant_id" {}

0 comments on commit 0a54838

Please sign in to comment.