forked from microsoft/project-oagents
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
many changes to marketing (microsoft#93)
- Loading branch information
1 parent
cd51e60
commit fc6c7cd
Showing
30 changed files
with
168 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,11 @@ | |
name: marketing | ||
metadata: | ||
template: [email protected] | ||
hooks: | ||
postprovision: | ||
interactive: false | ||
shell: pwsh | ||
run: infra/azd-hooks/Write-MarketingEnvironmentVariables.ps1 | ||
services: | ||
backend: | ||
project: "src/backend" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
samples/marketing/infra/azd-hooks/Write-MarketingEnvironmentVariables.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
# Make environment variables out of all outputs from bicep file | ||
Write-Verbose "---Setting environment variables..." -Verbose | ||
azd env get-values | % { | ||
$name,$value = $_.Split('=') | ||
|
||
#Value is quoted, so remove quotes | ||
$value = $value.Replace('"','') | ||
|
||
[System.Environment]::SetEnvironmentVariable($name,$value) | ||
Write-Verbose "Variable '$name' set to '$value'" -Verbose | ||
} | ||
Write-Verbose "---Done setting environment variables" -Verbose | ||
|
||
$templateFileName = ".env.template" | ||
$prodEnvFileName = ".env" | ||
|
||
# Replace the backend endpoint in the frontend .env file | ||
Write-Verbose "---Updating '$prodEnvFileName' file updated with backend endpoint..." -Verbose | ||
pushd src/frontend | ||
if (-not (Test-Path -Path $templateFileName)) { | ||
Write-Error "The file '$templateFileName' does not exist." | ||
} | ||
Copy-Item -Path $templateFileName -Destination $prodEnvFileName | ||
(Get-Content $prodEnvFileName) -replace '<AZURE_BACKEND_URI>', $env:AZURE_BACKEND_URI | Set-Content $prodEnvFileName | ||
popd | ||
Write-Verbose "---Done updating '$prodEnvFileName' file updated with backend endpoint..." -Verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
REACT_APP_BACKEND_URI=<AZURE_BACKEND_URI> | ||
NEXT_PUBLIC_BACKEND_URI=<AZURE_BACKEND_URI> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.