Skip to content

Commit

Permalink
Merge pull request microsoft#84 from dsrodenas/master
Browse files Browse the repository at this point in the history
Fix scripts issues
  • Loading branch information
olgamarti authored Feb 25, 2020
2 parents c45d996 + 8d27846 commit 2ce90cd
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Deploy/helm/cart-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-cart.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-cart.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/coupons-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-coupons.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-coupons.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/image-classifier-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-imageclassifier.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-imageclassifier.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/login-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-login.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-login.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/mobilebff/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-mobilebff.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-mobilebff.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/popular-products-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $cfginitname := printf "%s-%s" "cfg-init" $name -}}

apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-popularproducts.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/products-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-products.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-products.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/profiles-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-profile.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-profile.fullname" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-rewards-registration.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-rewards-registration.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/stock-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-stock.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-stock.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion Deploy/helm/webbff/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $name := include "tt-webbff.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tt-webbff.fullname" . }}
Expand Down
31 changes: 14 additions & 17 deletions Deploy/powershell/Generate-Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Write-Host "Storage Account: $($storage.name)" -ForegroundColor Yellow
## Getting CosmosDb info
$docdb=$(az cosmosdb list -g $resourceGroup --query "[?kind=='GlobalDocumentDB'].{name: name, kind:kind, documentEndpoint:documentEndpoint}" -o json | ConvertFrom-Json)
$docdb=EnsureAndReturnFirstItem $docdb "CosmosDB (Document Db)"
$docdbKey=$(az cosmosdb list-keys -g $resourceGroup -n $docdb.name -o json --query primaryMasterKey | ConvertFrom-Json)
$docdbKey=$(az cosmosdb keys list -g $resourceGroup -n $docdb.name -o json --query primaryMasterKey | ConvertFrom-Json)
Write-Host "Document Db Account: $($docdb.name)" -ForegroundColor Yellow

$mongodb=$(az cosmosdb list -g $resourceGroup --query "[?kind=='MongoDB'].{name: name, kind:kind}" -o json | ConvertFrom-Json)
$mongodb=EnsureAndReturnFirstItem $mongodb "CosmosDB (MongoDb mode)"
$mongodbKey=$(az cosmosdb list-keys -g $resourceGroup -n $mongodb.name -o json --query primaryMasterKey | ConvertFrom-Json)
$mongodbKey=$(az cosmosdb keys list -g $resourceGroup -n $mongodb.name -o json --query primaryMasterKey | ConvertFrom-Json)
Write-Host "Mongo Db Account: $($mongodb.name)" -ForegroundColor Yellow

If ($rewardsResourceGroup){
Expand All @@ -65,6 +65,18 @@ else {
$tokens.rewardspwd="password"
}

## Getting App Insights instrumentation key, if required
$appinsightsId=""
$appInsightsName=$(az resource list -g $resourceGroup --resource-type Microsoft.Insights/components --query [].name | ConvertFrom-Json)
if ($appInsightsName -and $appInsightsName.Length -eq 1) {
$appinsightsConfig=$(az monitor app-insights component show --app $appInsightsName[0] -g $resourceGroup -o json | ConvertFrom-Json)

if ($appinsightsConfig) {
$appinsightsId = $appinsightsConfig.instrumentationKey
}
}
Write-Host "App Insights Instrumentation Key: $($appinsightsId)" -ForegroundColor Yellow

## Showing Values that will be used

Write-Host "===========================================================" -ForegroundColor Yellow
Expand All @@ -79,21 +91,6 @@ $tokens.couponspwd=$mongodbKey

$tokens.storage=$storage.blob
$tokens.rewardsregistration=If ($rewardsResourceGroup) { $true } Else { $false }

$appinsightsId=""

## Getting App Insights instrumentation key, if required
$appInsightsName=$(az resource list -g $resourceGroup --resource-type Microsoft.Insights/components --query [].name | ConvertFrom-Json)
if ($appInsightsName -and $appInsightsName.Length -eq 1) {
$appinsightsConfig=$(az monitor app-insights component show --app $appInsightsName[0] -g $resourceGroup -o json | ConvertFrom-Json)

if ($appinsightsConfig) {
$appinsightsId = $appinsightsConfig.instrumentationKey
Write-Host "App Insights Instrumentation Key: $($appinsightsId)" -ForegroundColor Yellow
}
}

Write-Host "App Insights Instrumentation Key: $($appinsightsId)" -ForegroundColor Yellow
$tokens.appinsightsik=$appinsightsId

# Standard fixed tokens
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tailwindtradersbff.fullname" . }}
Expand Down

0 comments on commit 2ce90cd

Please sign in to comment.