Skip to content

Commit 0d7a468

Browse files
committed
Fixed DockerBuild.ps1
1 parent 387f57f commit 0d7a468

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

DockerBuild.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ function New-EnvJson
9696
# Convert to JSON and save
9797
$jsonPath = Join-Path $dockerContextDirectory "env.g.json"
9898

99+
# Ensure the directory exists
100+
if (-not (Test-Path $dockerContextDirectory))
101+
{
102+
New-Item -ItemType Directory -Path $dockerContextDirectory -Force | Out-Null
103+
}
104+
99105
# Write a test JSON file with GUID first
100106
@{ guid = [System.Guid]::NewGuid().ToString() } | ConvertTo-Json | Set-Content -Path $jsonPath -Encoding UTF8
101107

@@ -170,6 +176,12 @@ function New-ClaudeEnvJson
170176
# Convert to JSON and save
171177
$jsonPath = Join-Path $dockerContextDirectory "env.g.json"
172178

179+
# Ensure the directory exists
180+
if (-not (Test-Path $dockerContextDirectory))
181+
{
182+
New-Item -ItemType Directory -Path $dockerContextDirectory -Force | Out-Null
183+
}
184+
173185
# Write a test JSON file with GUID first
174186
@{ guid = [System.Guid]::NewGuid().ToString() } | ConvertTo-Json | Set-Content -Path $jsonPath -Encoding UTF8
175187

src/PostSharp.Engineering.BuildTools/Resources/DockerBuild.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ param(
2525

2626
####
2727
# These settings are replaced by the generate-scripts command.
28-
$EngPath = 'eng'
29-
$EnvironmentVariables = 'AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AZ_IDENTITY_USERNAME,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET,AZURE_DEVOPS_TOKEN,AZURE_DEVOPS_USER,AZURE_TENANT_ID,DOC_API_KEY,DOWNLOADS_API_KEY,ENG_USERNAME,GIT_USER_EMAIL,GIT_USER_NAME,GITHUB_AUTHOR_EMAIL,GITHUB_REVIEWER_TOKEN,GITHUB_TOKEN,IS_POSTSHARP_OWNED,IS_TEAMCITY_AGENT,MetalamaLicense,NUGET_ORG_API_KEY,PostSharpLicense,SIGNSERVER_SECRET,TEAMCITY_CLOUD_TOKEN,TYPESENSE_API_KEY,VS_MARKETPLACE_ACCESS_TOKEN,VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'
28+
$EngPath = '<ENG_PATH>'
29+
$EnvironmentVariables = '<ENVIRONMENT_VARIABLES>'
3030
####
3131

3232
$ErrorActionPreference = "Stop"
@@ -96,6 +96,12 @@ function New-EnvJson
9696
# Convert to JSON and save
9797
$jsonPath = Join-Path $dockerContextDirectory "env.g.json"
9898

99+
# Ensure the directory exists
100+
if (-not (Test-Path $dockerContextDirectory))
101+
{
102+
New-Item -ItemType Directory -Path $dockerContextDirectory -Force | Out-Null
103+
}
104+
99105
# Write a test JSON file with GUID first
100106
@{ guid = [System.Guid]::NewGuid().ToString() } | ConvertTo-Json | Set-Content -Path $jsonPath -Encoding UTF8
101107

@@ -170,6 +176,12 @@ function New-ClaudeEnvJson
170176
# Convert to JSON and save
171177
$jsonPath = Join-Path $dockerContextDirectory "env.g.json"
172178

179+
# Ensure the directory exists
180+
if (-not (Test-Path $dockerContextDirectory))
181+
{
182+
New-Item -ItemType Directory -Path $dockerContextDirectory -Force | Out-Null
183+
}
184+
173185
# Write a test JSON file with GUID first
174186
@{ guid = [System.Guid]::NewGuid().ToString() } | ConvertTo-Json | Set-Content -Path $jsonPath -Encoding UTF8
175187

0 commit comments

Comments
 (0)