Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
721d452
chore: add a Windows test on long path with git
lemeurherveCB Mar 26, 2025
24c1a2f
debug: true
lemeurherveCB Mar 26, 2025
7f006ef
debug: downgrade git from 2.49.0 to 2.47.1 in nanoserver image
lemeurherveCB Mar 26, 2025
eb6845d
ensure git and windows are configured for long paths
lemeurherveCB Mar 26, 2025
84074bf
limit builds for now
lemeurherveCB Mar 26, 2025
ff637dd
debug: downgrade git from 2.49.0 to 2.47.1 in windowsserver image (bu…
lemeurherveCB Mar 26, 2025
5b1cb67
disable make every-build too for now
lemeurherveCB Mar 26, 2025
9af4cb8
ensure git and windows are configured for long paths in windowsserver…
lemeurherveCB Mar 26, 2025
2385422
Revert "debug: downgrade git from 2.49.0 to 2.47.1 in windowsserver i…
lemeurherveCB Mar 26, 2025
f19b778
remove agent type limitation
lemeurherveCB Mar 26, 2025
16f20e7
remove image type limitation
lemeurherveCB Mar 26, 2025
3591ffa
remove linux skip
lemeurherveCB Mar 26, 2025
058f2b2
restore $env:TEST_DEBUG
lemeurherveCB Mar 26, 2025
c375743
proper test
lemeurherveCB Mar 27, 2025
4fb628c
git config longpaths for all users
lemeurherveCB Mar 30, 2025
ca88ee8
restore
lemeurherveCB Mar 30, 2025
bf954fb
Merge branch 'master' into add-git-long-path-test
lemeurherveCB Mar 31, 2025
8eef29c
Merge branch 'master' into add-git-long-path-test
lemeurherveCB Mar 31, 2025
fb62fc7
Update GIT_VERSION to 2.50.0 in wsc image
lemeurherveCB Jun 17, 2025
ed0582f
USER ContainerAdministrator for msiexec.exe
lemeurherveCB Jun 17, 2025
6fb690b
Revert "USER ContainerAdministrator for msiexec.exe"
lemeurherveCB Jun 17, 2025
59b87e3
switch to ZIP-based JDK installation
lemeurherveCB Jun 17, 2025
c9925b8
debug list folder
lemeurherveCB Jun 17, 2025
be748f4
debug
lemeurherveCB Jun 17, 2025
dad888c
more compact
lemeurherveCB Jun 17, 2025
587247f
fixup
lemeurherveCB Jun 17, 2025
abb7a39
Merge branch 'master' into add-git-long-path-test
lemeurherveCB Jun 17, 2025
3bb2f5a
fix merge conflict
lemeurherveCB Jun 17, 2025
e68281f
fixup
lemeurherveCB Jun 17, 2025
69233ef
debug zipUrl
lemeurherveCB Jun 17, 2025
f6c6fb5
fixup jdk21 url
lemeurherveCB Jun 17, 2025
04300a3
more debug
lemeurherveCB Jun 17, 2025
6c23f4b
fixup destination
lemeurherveCB Jun 17, 2025
34795b6
fixup
lemeurherveCB Jun 17, 2025
9a0771d
fixup
lemeurherveCB Jun 17, 2025
3a339b8
comment out 'can use git with a long path' for now, build stuck
lemeurherveCB Jun 17, 2025
5826918
Merge branch 'master' into add-git-long-path-test
lemeurherveCB Jun 17, 2025
dc54265
fixup merge conflict (??)
lemeurherveCB Jun 17, 2025
e8168f0
Revert "comment out 'can use git with a long path' for now, build stuck"
lemeurherveCB Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/agent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions windows/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions windows/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down