-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-container-apps.ps1
More file actions
72 lines (59 loc) ยท 3.57 KB
/
update-container-apps.ps1
File metadata and controls
72 lines (59 loc) ยท 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env pwsh
# ุชุญุฏูุซ Container Apps ุจุงูุตูุฑุฉ ู
ู ACR
$ACR = "cometxreg"
$RG = "rg-gratech-comet"
$IMAGE = "cometxreg.azurecr.io/gratech-cometx:latest"
Write-Host "`nโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" -ForegroundColor Cyan
Write-Host "๐ ุชุญุฏูุซ Container Apps" -ForegroundColor Green
Write-Host "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`n" -ForegroundColor Cyan
# ุจูุงูุงุช ACR
Write-Host "1๏ธโฃ ุงูุญุตูู ุนูู ุจูุงูุงุช ACR..." -ForegroundColor Yellow
$credentials = az acr credential show -n $ACR -o json | ConvertFrom-Json
$username = $credentials.username
$password = $credentials.passwords[0].value
Write-Host "โ
ุชู
`n" -ForegroundColor Green
# Production
Write-Host "2๏ธโฃ ุชุญุฏูุซ Production..." -ForegroundColor Yellow
az containerapp update `
--name ca-cometx-api `
--resource-group $RG `
--image $IMAGE `
--registry-server cometxreg.azurecr.io `
--registry-username $username `
--registry-password $password
if ($LASTEXITCODE -eq 0) {
Write-Host "โ
Production updated`n" -ForegroundColor Green
}
# Staging
Write-Host "3๏ธโฃ ุชุญุฏูุซ Staging..." -ForegroundColor Yellow
az containerapp update `
--name ca-cometx-api-staging `
--resource-group $RG `
--image $IMAGE `
--registry-server cometxreg.azurecr.io `
--registry-username $username `
--registry-password $password
if ($LASTEXITCODE -eq 0) {
Write-Host "โ
Staging updated`n" -ForegroundColor Green
}
# ุงูุชุญูู
Write-Host "4๏ธโฃ ุงูุชุญูู ู
ู ุงูุญุงูุฉ..." -ForegroundColor Yellow
$prod = az containerapp show --name ca-cometx-api --resource-group $RG --query "{fqdn:properties.configuration.ingress.fqdn,image:properties.template.containers[0].image}" -o json | ConvertFrom-Json
$staging = az containerapp show --name ca-cometx-api-staging --resource-group $RG --query "{fqdn:properties.configuration.ingress.fqdn,image:properties.template.containers[0].image}" -o json | ConvertFrom-Json
Write-Host ""
Write-Host "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" -ForegroundColor Green
Write-Host "๐ ุชู
ุงูุชุญุฏูุซ ุจูุฌุงุญ!" -ForegroundColor Green
Write-Host "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`n" -ForegroundColor Green
Write-Host "๐ Production:" -ForegroundColor Cyan
Write-Host " FQDN: $($prod.fqdn)" -ForegroundColor White
Write-Host " Image: $($prod.image)" -ForegroundColor Gray
Write-Host " URL: https://app.gratech.sa`n" -ForegroundColor White
Write-Host "๐ Staging:" -ForegroundColor Cyan
Write-Host " FQDN: $($staging.fqdn)" -ForegroundColor White
Write-Host " Image: $($staging.image)" -ForegroundColor Gray
Write-Host " URL: https://staging.gratech.sa`n" -ForegroundColor White
Write-Host "๐ ุงุฎุชุจุงุฑ ุณุฑูุน:" -ForegroundColor Yellow
curl.exe -I https://app.gratech.sa
Write-Host ""
curl.exe -I https://staging.gratech.sa
Write-Host "`nโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" -ForegroundColor Cyan