Skip to content

Commit

Permalink
[TW-87124] Windows 2022-based Agent Images become incompatible with s…
Browse files Browse the repository at this point in the history
…ome runners after restart (#164)

* Remove 'plugins' folder during the build of the container.

* Add removal of 'plugins' directory from Windows 2022 images into source Dockerfile.

* Remove SHELL instruction which is no longer needed.
  • Loading branch information
AndreyKoltsov1997 authored Jun 27, 2024
1 parent 44bf0d4 commit 3f12cfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ USER ContainerAdministrator
COPY scripts/*.cs /scripts/
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# CaseSensitivity is essential for the agent => enforcing it. SHELL usage is mandatory (pwsh or other won't work)
RUN mkdir C:\\BuildAgent
SHELL ["pwsh", "-Command", "fsutil.exe", "file", "SetCaseSensitiveInfo", "C:\\BuildAgent", "enable"]

# Prepare build agent distribution
RUN mkdir C:\\BuildAgent
COPY TeamCity/buildAgent C:/BuildAgent

# Workaround for TW-87124 - Windows 2022-based plugin directories receive incorrect case, causing their inability ...
# ... to load. The directory will be fetched from the server upon the first update with proper case.
RUN Remove-Item -Recurse -Force C:/BuildAgent/plugins

COPY run-agent.ps1 /BuildAgent/run-agent.ps1

# JDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ USER ContainerAdministrator
COPY scripts/*.cs /scripts/
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# CaseSensitivity is essential for the agent => enforcing it. SHELL usage is mandatory (pwsh or other won't work)
RUN mkdir C:\\BuildAgent
SHELL ["pwsh", "-Command", "fsutil.exe", "file", "SetCaseSensitiveInfo", "C:\\BuildAgent", "enable"]

# Prepare build agent distribution
RUN mkdir C:\\BuildAgent
COPY TeamCity/buildAgent C:/BuildAgent

# Workaround for TW-87124 - Windows 2022-based plugin directories receive incorrect case, causing their inability ...
# ... to load. The directory will be fetched from the server upon the first update with proper case.
RUN Remove-Item -Recurse -Force C:/BuildAgent/plugins

COPY run-agent.ps1 /BuildAgent/run-agent.ps1

# JDK
Expand Down

0 comments on commit 3f12cfc

Please sign in to comment.