diff --git a/tests/agent.Tests.ps1 b/tests/agent.Tests.ps1 index ad963e860..968fffa3a 100644 --- a/tests/agent.Tests.ps1 +++ b/tests/agent.Tests.ps1 @@ -88,6 +88,13 @@ Describe "[$global:IMAGE_NAME] image has correct applications in the PATH" { $stdout.Trim() | Should -Match "git-lfs/${global:GITLFSVERSION}" } + It 'can use git with a long path' { + $longPath = 'C:\source\temp\' + ('a' * 260) + '\repo' + $repository = 'https://github.com/jenkinsci/pipeline-model-definition-plugin.git' + $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"New-Item -ItemType Directory -Path ${longPath} ; cd ${longPath} ; git init ; git remote add origin $repository ; git fetch origin ; git checkout master`"" + $exitCode | Should -Be 0 + } + It 'does not include jenkins-agent.ps1 (inbound-agent)' { $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"if (Test-Path C:/ProgramData/Jenkins/jenkins-agent.ps1) { exit -1 } else { exit 0 }`"" $exitCode | Should -Be 0 diff --git a/windows/nanoserver/Dockerfile b/windows/nanoserver/Dockerfile index af20c2e5c..1668cccf2 100644 --- a/windows/nanoserver/Dockerfile +++ b/windows/nanoserver/Dockerfile @@ -32,10 +32,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ARG JAVA_VERSION=17.0.15+6 RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` $javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; ` - $msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('_', '%2B') ; ` - Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` - $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; ` - $proc.WaitForExit() ; ` + $zipUrl = 'https://github.com/adoptium/temurin{0}-binaries/releases/download/jdk-{1}/OpenJDK{0}U-jdk_x64_windows_hotspot_{2}.zip' -f $javaMajorVersion, $env:JAVA_VERSION.Replace('+', '%2B'), $env:JAVA_VERSION.Replace('+', '_') ; ` + Invoke-WebRequest $zipUrl -OutFile 'C:\temp\jdk.zip' ; ` + Expand-Archive C:\temp\jdk.zip -DestinationPath C:\ ; ` + Move-Item -Path (Get-ChildItem -Path C:\ -Directory -Filter "jdk-*")[0].FullName -Destination ('C:\openjdk-{0}' -f $javaMajorVersion) ; ` Remove-Item -Path C:\temp -Recurse | Out-Null FROM mcr.microsoft.com/powershell:nanoserver-"${TOOLS_WINDOWS_VERSION}" AS pwsh-source @@ -56,7 +56,7 @@ COPY --from=pwsh-source $PSHOME $PSHOME SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] USER ContainerAdministrator -ARG GIT_VERSION=2.49.0 +ARG GIT_VERSION=2.50.0 ARG GIT_PATCH_VERSION=1 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) diff --git a/windows/windowsservercore/Dockerfile b/windows/windowsservercore/Dockerfile index 4eb641452..589bee094 100644 --- a/windows/windowsservercore/Dockerfile +++ b/windows/windowsservercore/Dockerfile @@ -32,10 +32,10 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ARG JAVA_VERSION=17.0.15+6 RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` $javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; ` - $msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('_', '%2B') ; ` - Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` - $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; ` - $proc.WaitForExit() ; ` + $zipUrl = 'https://github.com/adoptium/temurin{0}-binaries/releases/download/jdk-{1}/OpenJDK{0}U-jdk_x64_windows_hotspot_{2}.zip' -f $javaMajorVersion, $env:JAVA_VERSION.Replace('+', '%2B'), $env:JAVA_VERSION.Replace('+', '_') ; ` + Invoke-WebRequest $zipUrl -OutFile 'C:\temp\jdk.zip' ; ` + Expand-Archive C:\temp\jdk.zip -DestinationPath C:\ ; ` + Move-Item -Path (Get-ChildItem -Path C:\ -Directory -Filter "jdk-*")[0].FullName -Destination ('C:\openjdk-{0}' -f $javaMajorVersion) ; ` Remove-Item -Path C:\temp -Recurse | Out-Null ## Agent image target @@ -48,7 +48,7 @@ COPY --from=jdk-core $JAVA_HOME $JAVA_HOME SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ARG GIT_VERSION=2.49.0 +ARG GIT_VERSION=2.50.0 ARG GIT_PATCH_VERSION=1 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different)