-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupload-content.ps1
More file actions
30 lines (23 loc) · 1.25 KB
/
upload-content.ps1
File metadata and controls
30 lines (23 loc) · 1.25 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
# Build and run ContentLoader to upload markdown files to Azure Storage Emulator
# Usage: ./upload-content.ps1
# Set strict mode
Set-StrictMode -Version Latest
# Define paths
$solutionRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$contentLoaderPath = Join-Path $solutionRoot 'ContentLoader'
$contentPath = Join-Path $solutionRoot 'Content'
# Build ContentLoader
Write-Host 'Building ContentLoader...'
dotnet build $contentLoaderPath --configuration Debug
if ($LASTEXITCODE -ne 0) {
Write-Error 'Build failed. Exiting.'
exit 1
}
# Set Azure Storage Emulator connection string (using ports from AppHost.cs)
$storageEmulatorConnectionString = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:27002/devstoreaccount1;BlobEndpoint=http://127.0.0.1:27001/devstoreaccount1;'
# Export connection string for ContentLoader (if it reads from env)
$env:AZURE_STORAGE_CONNECTION_STRING = $storageEmulatorConnectionString
# Run ContentLoader to upload markdown files
Write-Host 'Running ContentLoader to upload markdown files...'
dotnet run --project $contentLoaderPath -- $contentPath
Write-Host 'Content upload complete.'