|
7 | 7 | [string] $project = "", |
8 | 8 | [Parameter(HelpMessage = "Specifies a mode to use for the build steps", Mandatory = $false)] |
9 | 9 | [string] $buildMode = 'Default', |
10 | | - [Parameter(HelpMessage = "A JSON-formatted list of apps to install", Mandatory = $false)] |
11 | | - [string] $installAppsJson = '[]', |
12 | | - [Parameter(HelpMessage = "A JSON-formatted list of test apps to install", Mandatory = $false)] |
13 | | - [string] $installTestAppsJson = '[]', |
| 10 | + [Parameter(HelpMessage = "A path to a JSON-formatted list of apps to install", Mandatory = $false)] |
| 11 | + [string] $installAppsJson = '', |
| 12 | + [Parameter(HelpMessage = "A path to a JSON-formatted list of test apps to install", Mandatory = $false)] |
| 13 | + [string] $installTestAppsJson = '', |
14 | 14 | [Parameter(HelpMessage = "RunId of the baseline workflow run", Mandatory = $false)] |
15 | 15 | [string] $baselineWorkflowRunId = '0', |
16 | 16 | [Parameter(HelpMessage = "SHA of the baseline workflow run", Mandatory = $false)] |
@@ -187,8 +187,26 @@ try { |
187 | 187 | } |
188 | 188 |
|
189 | 189 | $install = @{ |
190 | | - "Apps" = $settings.installApps + @($installAppsJson | ConvertFrom-Json) |
191 | | - "TestApps" = $settings.installTestApps + @($installTestAppsJson | ConvertFrom-Json) |
| 190 | + "Apps" = $settings.installApps |
| 191 | + "TestApps" = $settings.installTestApps |
| 192 | + } |
| 193 | + |
| 194 | + if ($installAppsJson -and (Test-Path $installAppsJson)) { |
| 195 | + try { |
| 196 | + $install.Apps += @(Get-Content -Path $installAppsJson -Raw | ConvertFrom-Json) |
| 197 | + } |
| 198 | + catch { |
| 199 | + throw "Failed to parse JSON file at path '$installAppsJson'. Error: $($_.Exception.Message)" |
| 200 | + } |
| 201 | + } |
| 202 | + |
| 203 | + if ($installTestAppsJson -and (Test-Path $installTestAppsJson)) { |
| 204 | + try { |
| 205 | + $install.TestApps += @(Get-Content -Path $installTestAppsJson -Raw | ConvertFrom-Json) |
| 206 | + } |
| 207 | + catch { |
| 208 | + throw "Failed to parse JSON file at path '$installTestAppsJson'. Error: $($_.Exception.Message)" |
| 209 | + } |
192 | 210 | } |
193 | 211 |
|
194 | 212 | # Replace secret names in install.apps and install.testApps |
|
0 commit comments