Skip to content

Commit 9b1eb12

Browse files
authored
Windows: tweak LTSC2022 nightly image creation (#442)
- Use HTTPS for the latest download info. - Immediately convert from JSON to help make failures more understandable. - Perform the JSON conversion once to avoid repeated parsing.
1 parent c8234ac commit 9b1eb12

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nightly-main/windows/LTSC2022/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:VSB});
127127
Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\*
128128

129129
# Install Swift toolchain.
130-
ARG SWIFT_RELEASE_METADATA=http://download.swift.org/development/windows10/latest-build.json
131-
RUN $env:Release = curl.exe -sL ${env:SWIFT_RELEASE_METADATA}; \
132-
$env:SWIFT_URL = "\"https://download.swift.org/development/windows10/$($($env:Release | ConvertFrom-JSON).dir)/$($($env:Release | ConvertFrom-JSON).download)\""; \
133-
Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT_URL}); \
134-
Invoke-WebRequest -Uri ${env:SWIFT_URL} -OutFile installer.exe; \
130+
ARG SWIFT_RELEASE_METADATA=https://download.swift.org/development/windows10/latest-build.json
131+
RUN $Release = curl.exe -sL ${env:SWIFT_RELEASE_METADATA} | ConvertFrom-JSON; \
132+
$SWIFT_URL = "\"https://download.swift.org/development/windows10/$($Release.dir)/$($Release.download)\""; \
133+
Write-Host -NoNewLine ('Downloading {0} ... ' -f ${SWIFT_URL}); \
134+
Invoke-WebRequest -Uri ${SWIFT_URL} -OutFile installer.exe; \
135135
Write-Host '✓'; \
136136
Write-Host -NoNewLine 'Installing Swift ... '; \
137137
$Process = \

0 commit comments

Comments
 (0)