Skip to content

Commit

Permalink
push middleware image to dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Dec 5, 2024
1 parent 6ebfb09 commit f162efa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/build-deploy-ocr.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Create, publish, deploy a OCR API image

on:
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: put-middle-behind-app-gateway
# 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 @@ -35,7 +37,7 @@ jobs:
shell: bash
id: set_tag
run: |
USER_INPUT="${{ github.event.inputs.ocr-docker-tag }}"
USER_INPUT="94c027a592208de803795dd22efa4fb4c27f914e"
echo "docker_tag=$(
#this gives a new sha as default if dispatch input is empty
echo ${USER_INPUT:-"${{ github.sha }}"}
Expand All @@ -44,7 +46,7 @@ jobs:
id: image_check
run: |
echo "docker_inspect=$(
docker manifest inspect ghcr.io/${{ env.REPO }}-ocr:${{ steps.set_tag.outputs.docker_tag }} > /dev/null ; echo $?
docker manifest inspect ghcr.io/${{ env.REPO }}-middleware:${{ steps.set_tag.outputs.docker_tag }} > /dev/null ; echo $?
)" >> $GITHUB_OUTPUT
- name: Build and Push backend
if: ${{ steps.image_check.outputs.docker_inspect == 1 }}
Expand All @@ -54,14 +56,14 @@ jobs:
docker-pw: ${{ secrets.GITHUB_TOKEN }}
docker-username: ${{ github.actor }}
docker-tag: ${{ steps.set_tag.outputs.docker_tag }}
dockerfile-path: ./OCR/Dockerfile
docker-context-path: ./OCR/
api-name: ocr
dockerfile-path: ./backend/Dockerfile
docker-context-path: ./backend/
api-name: middleware

deploy-ocr:
name: Deploy OCR
runs-on: ubuntu-latest
environment: ${{ inputs.deploy-env }}
environment: dev
needs: [build-publish-ocr]
steps:
- uses: actions/checkout@v4
Expand All @@ -73,7 +75,7 @@ jobs:
- name: Deploy OCR-API
uses: ./.github/actions/deploy-api
with:
deploy-env: ${{ inputs.deploy-env }}
deploy-env: dev
docker-tag: ${{ needs.build-publish-ocr.outputs.docker_tag }}
docker-registry: ghcr.io
api-name: ocr
api-name: middleware
16 changes: 8 additions & 8 deletions ops/terraform/modules/app_gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ resource "azurerm_public_ip" "lb-pip" {
locals {
backend_address_pool_name_static = "${var.name}-${var.env}-beap-static"
backend_address_pool_name_api_ocr = "${var.name}-${var.env}-beap-api-ocr"
backend_address_pool_name_api_middleware = "${var.name}-${var.env}-beap-api"
backend_address_pool_name_api_middleware = "${var.name}-${var.env}-beap-api-middleware"
frontend_port_name_api_ocr = "${var.name}-${var.env}-feport-api-ocr"
frontend_port_name_api_middleware = "${var.name}-${var.env}-feport-api"
frontend_port_name_api_middleware = "${var.name}-${var.env}-feport-api-middleware"
frontend_port_name_static = "${var.name}-${var.env}-feport-static"
frontend_ip_configuration_name = "${var.name}-${var.env}-feip"
http_setting_name_static = "${var.name}-${var.env}-be-htst-static"
http_setting_name_api_ocr = "${var.name}-${var.env}-be-htst-api-ocr"
http_setting_name_api_middleware = "${var.name}-${var.env}-be-htst-api"
http_setting_name_api_middleware = "${var.name}-${var.env}-be-htst-api-middleware"
listener_name_static = "${var.name}-${var.env}-httplstn-static"
listener_name_api_ocr = "${var.name}-${var.env}-httplstn-api-ocr"
listener_name_api_middleware = "${var.name}-${var.env}-httplstn-api"
listener_name_api_middleware = "${var.name}-${var.env}-httplstn-api-middleware"
request_routing_rule_name_api_ocr = "${var.name}-${var.env}-rqrt-api-ocr"
request_routing_rule_name_api_middleware = "${var.name}-${var.env}-rqrt-api"
request_routing_rule_name_api_middleware = "${var.name}-${var.env}-rqrt-api-middleware"
request_routing_rule_name_static = "${var.name}-${var.env}-rqrt-static"
redirect_configuration_name = "${var.name}-${var.env}-rdrcfg"
static_probe_name_app = "${var.name}-${var.env}-be-probe-app-static"
api_probe_name_app_ocr = "${var.name}-${var.env}-be-probe-app-api-ocr"
api_probe_name_app_middleware = "${var.name}-${var.env}-be-probe-app-api_middleware"
api_probe_name_app_middleware = "${var.name}-${var.env}-be-probe-app-api-middleware"
redirect_rule = "${var.name}-${var.env}-redirect"
}

Expand Down Expand Up @@ -132,7 +132,7 @@ resource "azurerm_application_gateway" "load_balancer" {
unhealthy_threshold = 3
protocol = "Https"
port = 443
path = "/api"
path = "/actuator/health"
pick_host_name_from_backend_http_settings = true
match {
body = "UP"
Expand Down Expand Up @@ -209,7 +209,7 @@ resource "azurerm_application_gateway" "load_balancer" {
name = "${var.name}-${var.env}-urlmap"
default_backend_address_pool_name = local.backend_address_pool_name_static
default_backend_http_settings_name = local.http_setting_name_static
default_rewrite_rule_set_name = "${var.name}-routing"
default_rewrite_rule_set_name = "${var.name}-middleware-routing"

path_rule {
name = "ocr"
Expand Down

0 comments on commit f162efa

Please sign in to comment.