File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,17 @@ WORKDIR "C:/Program Files/Vector"
1010
1111SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
1212
13- RUN Write-Host "VECTOR_VERSION: $env:VECTOR_VERSION" ; \
14- $url = "https://github.com/vectordotdev/vector/releases/download/v${env:VECTOR_VERSION}/vector-${env:VECTOR_VERSION}-x86_64-pc-windows-msvc.zip" ; \
13+ RUN if ($env:VECTOR_VERSION) { \
14+ $version = $env:VECTOR_VERSION; \
15+ Write-Host "Using pinned VECTOR_VERSION: $version" ; \
16+ } else { \
17+ Write-Host "VECTOR_VERSION not set. Fetching latest version from GitHub API..." ; \
18+ $apiUrl = "https://api.github.com/repos/vectordotdev/vector/releases/latest" ; \
19+ $releaseInfo = Invoke-RestMethod -Uri $apiUrl; \
20+ $version = $releaseInfo.tag_name.TrimStart('v' ); \
21+ Write-Host "Latest version found: $version" ; \
22+ } \
23+ $url = "https://github.com/vectordotdev/vector/releases/download/v${version}/vector-${version}-x86_64-pc-windows-msvc.zip" ; \
1524 Write-Host "Download URL: $url" ; \
1625 Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile "vector.zip" ; \
1726 Expand-Archive -Path "vector.zip" -DestinationPath "." ; \
You can’t perform that action at this time.
0 commit comments