Skip to content

Commit

Permalink
[TCQA] Remove unused file.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyKoltsov1997 committed Nov 24, 2023
1 parent 6e11287 commit 9f0eb9c
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down
98 changes: 98 additions & 0 deletions context/generated/windows/Agent/windowsservercore/2004/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Default arguments
ARG dotnetWindowsComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-win-x64.zip'
ARG dotnetWindowsComponentSHA512='a9e1bbb52484ad0667b258451ebb6b47ce6c7b788c015aee8a86c5e0c4dcf4ee8c82d796921869d64c92bb2afef2c7ceea09cfe255d8519d48f2471a098c361e'
ARG gitWindowsComponent='https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/MinGit-2.43.0-64-bit.zip'
ARG gitWindowsComponentSHA256='1905d93068e986258fafc69517df8fddff829bb2a289c1fa4dcc6cdf720ddf36'
ARG jdkWindowsComponent='https://corretto.aws/downloads/resources/17.0.7.7.1/amazon-corretto-17.0.7.7.1-windows-x64-jdk.zip'
ARG jdkWindowsComponentMD5SUM='feb7eab99c647a0b4347be9f0a3276de'
ARG mercurialWindowsComponent='https://www.mercurial-scm.org/release/windows/mercurial-5.9.1-x64.msi'
ARG teamcityMinimalAgentImage='teamcity-minimal-agent:2023.11-nanoserver-2004'
ARG windowsservercoreImage='mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004'

# The list of required arguments
# ARG windowsservercoreImage
# ARG dotnetWindowsComponent
# ARG dotnetWindowsComponentSHA512
# ARG jdkWindowsComponent
# ARG jdkWindowsComponentMD5SUM
# ARG gitWindowsComponent
# ARG gitWindowsComponentSHA256
# ARG mercurialWindowsComponentName
# ARG teamcityMinimalAgentImage




FROM ${teamcityMinimalAgentImage} AS buildagent

ARG windowsservercoreImage
FROM ${windowsservercoreImage}

COPY scripts/*.cs /scripts/

# PowerShell
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ARG dotnetWindowsComponent
ARG dotnetWindowsComponentSHA512
ARG jdkWindowsComponent
ARG jdkWindowsComponentMD5SUM
ARG gitWindowsComponent
ARG gitWindowsComponentSHA256
ARG mercurialWindowsComponent

RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \
$code = Get-Content -Path "scripts/Web.cs" -Raw ; \
Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \
$downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \
Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \
# .NET 6.0, .NET Framework 4 is inherited from base image
Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \
Remove-Item -Force dotnet.zip; \
Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \
# JDK
Expand-Archive jdk.zip -DestinationPath $Env:ProgramFiles\Java ; \
Get-ChildItem $Env:ProgramFiles\Java | Rename-Item -NewName "OpenJDK" ; \
Remove-Item $Env:ProgramFiles\Java\OpenJDK\lib\src.zip -Force ; \
Remove-Item -Force jdk.zip ; \
# Git
$gitPath = $Env:ProgramFiles + '\Git'; \
Expand-Archive git.zip -DestinationPath $gitPath ; \
Remove-Item -Force git.zip ; \
# avoid circular dependencies in gitconfig
$gitConfigFile = $gitPath + '\etc\gitconfig'; \
$configContent = Get-Content $gitConfigFile; \
$configContent = $configContent.Replace('path = C:/Program Files/Git/etc/gitconfig', ''); \
Set-Content $gitConfigFile $configContent; \
# Mercirual
Start-Process msiexec -Wait -ArgumentList /q, /i, hg.msi ; \
Remove-Item -Force hg.msi

COPY --from=buildagent /BuildAgent /BuildAgent

EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \
# Java home directory
JAVA_HOME="C:\Program Files\Java\OpenJDK" \
# Opt out of the telemetry feature
DOTNET_CLI_TELEMETRY_OPTOUT=true \
# Disable first time experience
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true \
# Configure Kestrel web server to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps perfomance
NUGET_XMLDOC_MODE=skip

USER ContainerAdministrator
RUN setx /M PATH ('{0};{1}\bin;C:\Program Files\Git\cmd;C:\Program Files\Mercurial' -f $env:PATH, $env:JAVA_HOME)
USER ContainerUser
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ EXPOSE 9090

VOLUME C:/BuildAgent/conf

CMD ["pwsh", "./BuildAgent/run-agent.ps1"]
CMD ["powershell", "./BuildAgent/run-agent.ps1"]

# Configuration file for TeamCity agent
ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \
Expand Down

0 comments on commit 9f0eb9c

Please sign in to comment.