22# Get all environment values
33$envValues = azd env get-values -- output json | ConvertFrom-Json
44
5+ # Full path to this script's folder
6+ $ScriptDir = $PSScriptRoot
7+
8+ # Resolve relative paths based on the script location
9+ $TemplateFile = Join-Path $ScriptDir " ..\deploy_container_registry.bicep"
10+ $ContentProcessorPath = Join-Path $ScriptDir " ..\..\src\ContentProcessor"
11+ $ContentApiPath = Join-Path $ScriptDir " ..\..\src\ContentProcessorAPI"
12+ $ContentWebPath = Join-Path $ScriptDir " ..\..\src\ContentProcessorWeb"
13+
514# Define function to build and push Docker images
615function Build-And-Push-Image {
716 param (
@@ -110,7 +119,7 @@ Write-Output "Starting build process."
110119
111120# Deploy container registry
112121Write-Host " Deploying container registry"
113- $OUTPUTS = az deployment group create -- resource- group $AZURE_RESOURCE_GROUP -- template- file " ./infra/deploy_container_registry.bicep " -- parameters environmentName= $ENV_NAME acrPullPrincipalIds= " ['$ ( $CONTAINER_APP_USER_PRINCIPAL_ID ) ']" -- query " properties.outputs" -- output json | ConvertFrom-Json
122+ $OUTPUTS = az deployment group create -- resource- group $AZURE_RESOURCE_GROUP -- template- file " $TemplateFile " -- parameters environmentName= $ENV_NAME acrPullPrincipalIds= " ['$ ( $CONTAINER_APP_USER_PRINCIPAL_ID ) ']" -- query " properties.outputs" -- output json | ConvertFrom-Json
114123
115124# Extract ACR name and endpoint
116125$ACR_NAME = $OUTPUTS.createdAcrName.value
@@ -134,8 +143,8 @@ if ($LASTEXITCODE -ne 0) {
134143}
135144
136145# Build and push images
137- Build-And - Push-Image " contentprocessor" " .\src\ContentProcessor\ " $CONTAINER_APP_NAME
138- Build-And - Push-Image " contentprocessorapi" " .\src\ContentProcessorAPI\ " $CONTAINER_API_APP_NAME
139- Build-And - Push-Image " contentprocessorweb" " .\src\ContentProcessorWeb\ " $CONTAINER_WEB_APP_NAME
146+ Build-And - Push-Image " contentprocessor" " $ContentProcessorPath " $CONTAINER_APP_NAME
147+ Build-And - Push-Image " contentprocessorapi" " $ContentApiPath " $CONTAINER_API_APP_NAME
148+ Build-And - Push-Image " contentprocessorweb" " $ContentWebPath " $CONTAINER_WEB_APP_NAME
140149
141150Write-Host " All Docker images built and pushed successfully."
0 commit comments