@@ -10,6 +10,12 @@ Param(
10
10
)
11
11
12
12
$ErrorActionPreference = ' Stop'
13
+
14
+ $originalDockerComposeFile = ' build-windows.yaml'
15
+ $finalDockerComposeFile = ' build-windows-current.yaml'
16
+ $baseDockerCmd = ' docker-compose --file={0}' -f $finalDockerComposeFile
17
+ $baseDockerBuildCmd = ' {0} build --parallel --pull' -f $baseDockerCmd
18
+
13
19
$AgentTypes = @ (' agent' , ' inbound-agent' )
14
20
if ($AgentType -ne ' ' -and $AgentType -in $AgentTypes ) {
15
21
$AgentTypes = @ ($AgentType )
@@ -102,13 +108,15 @@ function Test-Image {
102
108
$items = $AgentTypeAndImageName.Split (" |" )
103
109
$agentType = $items [0 ]
104
110
$imageName = $items [1 ]
111
+ $javaVersion = $items [2 ]
105
112
$imageNameItems = $imageName.Split (" :" )
106
113
$imageTag = $imageNameItems [1 ]
107
114
108
115
Write-Host " = TEST: Testing ${imageName} image:"
109
116
110
117
$env: IMAGE_NAME = $imageName
111
118
$env: VERSION = " $RemotingVersion "
119
+ $env: JAVA_VERSION = " $javaVersion "
112
120
113
121
$targetPath = ' .\target\{0}\{1}' -f $agentType , $imageTag
114
122
if (Test-Path $targetPath ) {
@@ -128,15 +136,11 @@ function Test-Image {
128
136
129
137
Remove-Item env:\IMAGE_NAME
130
138
Remove-Item env:\VERSION
139
+ Remove-Item env:\JAVA_VERSION
131
140
132
141
return $failed
133
142
}
134
143
135
- $originalDockerComposeFile = ' build-windows.yaml'
136
- $finalDockerComposeFile = ' build-windows-current.yaml'
137
- $baseDockerCmd = ' docker-compose --file={0}' -f $finalDockerComposeFile
138
- $baseDockerBuildCmd = ' {0} build --parallel --pull' -f $baseDockerCmd
139
-
140
144
foreach ($agentType in $AgentTypes ) {
141
145
# Ensure remaining env vars used in the docker compose file are defined
142
146
$env: AGENT_TYPE = $agentType
@@ -196,8 +200,9 @@ foreach($agentType in $AgentTypes) {
196
200
Write-Host " = TEST: Testing all ${agentType} images..."
197
201
# Only fail the run afterwards in case of any test failures
198
202
$testFailed = $false
199
- Invoke-Expression " $baseDockerCmd config" | yq ' .services[].image' | ForEach-Object {
200
- $testFailed = $testFailed -or (Test-Image (' {0}|{1}' -f $agentType , $_ ))
203
+ $jdks = Invoke-Expression " $baseDockerCmd config" | yq - r -- output- format json ' .services' | ConvertFrom-Json
204
+ foreach ($jdk in $jdks.PSObject.Properties ) {
205
+ $testFailed = $testFailed -or (Test-Image (' {0}|{1}|{2}' -f $agentType , $jdk.Value.image , $jdk.Value.build.args.JAVA_VERSION ))
201
206
}
202
207
203
208
# Fail if any test failures
0 commit comments