Skip to content

Commit

Permalink
Modified script to change username and password in bootstrap/Global.j…
Browse files Browse the repository at this point in the history
…son file (#50)
  • Loading branch information
jeanfrancoislarente committed Aug 16, 2018
1 parent 90b8e41 commit 6d9715e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deploy-commerce-engine.ps1
Expand Up @@ -37,6 +37,8 @@ Function Start-CommerceEnginePepare ( [string] $basePublishPath = $(Join-Path $
$pathToGlobalJson = $(Join-Path -Path $basePublishPath -ChildPath "wwwroot\bootstrap\Global.json")
$global = Get-Content $pathToGlobalJson -Raw | ConvertFrom-Json
$global.Policies.'$values'[5].Host = $siteName
$global.Policies.'$values'[5].UserName = $adminUser
$global.Policies.'$values'[5].Password = $adminPassword
$global | ConvertTo-Json -Depth 10 -Compress | set-Content $pathToGlobalJson
$pathToJson = $(Join-Path -Path $basePublishPath -ChildPath "wwwroot\config.json")

Expand Down Expand Up @@ -148,6 +150,7 @@ Function Get-IdServerToken {
$sitecoreIdToken = "Bearer {0}" -f $response.access_token

$global:sitecoreIdToken = $sitecoreIdToken
Write-Host $global:sitecoreIdToken
}
Function CleanEnvironment {
Write-Host "Cleaning Environments" -ForegroundColor Green
Expand All @@ -157,7 +160,7 @@ Function CleanEnvironment {
$Environments = @("HabitatAuthoring")

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
Write-Host $global:sitecoreIdToken

$headers.Add("Authorization", $global:sitecoreIdToken);

foreach ($env in $Environments) {
Expand Down

0 comments on commit 6d9715e

Please sign in to comment.