Skip to content

Commit

Permalink
Merge pull request #148 from slide/windows_git_fixes
Browse files Browse the repository at this point in the history
Fix for git in nanoserver containers
  • Loading branch information
slide authored Jul 24, 2020
2 parents 346adc7 + cb6c94b commit acc220e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 1 addition & 5 deletions 11/windows/nanoserver-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
ARG POWERSHELL_VERSION=
FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809

ARG JAVA_VERSION=11.0.6+10
ARG JAVA_SHA256=6fb8b6c254ec0e1091acd421ac79c1bb07b295de0b679c0595fd284caf7734e5
ARG JAVA_HOME=C:\jdk-${JAVA_VERSION}

SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV JAVA_VERSION jdk-11.0.7+10
Expand Down Expand Up @@ -58,7 +54,7 @@ LABEL Description="This is a base image, which provides the Jenkins agent execut
ARG GIT_VERSION=2.26.0
ARG GIT_PATCH_VERSION=1
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-busybox-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; `
Expand-Archive mingit.zip -DestinationPath c:\mingit ; `
Expand Down
10 changes: 6 additions & 4 deletions 11/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ LABEL Description="This is a base image, which provides the Jenkins agent execut
ARG GIT_VERSION=2.26.0
ARG GIT_PATCH_VERSION=1
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-busybox-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; `
Expand-Archive mingit.zip -DestinationPath c:\mingit ; `
Remove-Item mingit.zip -Force ; `
setx /M PATH $('c:\mingit\cmd;{0}' -f $env:PATH)
Remove-Item mingit.zip -Force

ARG GIT_LFS_VERSION=2.10.0
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
Expand All @@ -46,7 +45,10 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; `
Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; `
Remove-Item GitLfs.zip -Force ; `
& C:\mingit\cmd\git.exe lfs install
& C:\mingit\cmd\git.exe lfs install ; `
$CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
$NewPath = $CurrentPath + ';C:\mingit\cmd' ; `
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath

ARG user=jenkins

Expand Down
2 changes: 1 addition & 1 deletion 8/windows/nanoserver-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ LABEL Description="This is a base image, which provides the Jenkins agent execut
ARG GIT_VERSION=2.26.0
ARG GIT_PATCH_VERSION=1
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-busybox-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; `
Expand-Archive mingit.zip -DestinationPath c:\mingit ; `
Expand Down
10 changes: 6 additions & 4 deletions 8/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ LABEL Description="This is a base image, which provides the Jenkins agent execut
ARG GIT_VERSION=2.26.0
ARG GIT_PATCH_VERSION=1
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-busybox-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; `
Expand-Archive mingit.zip -DestinationPath c:\mingit ; `
Remove-Item mingit.zip -Force ; `
setx /M PATH $('c:\mingit\cmd;{0}' -f $env:PATH)
Remove-Item mingit.zip -Force

ARG GIT_LFS_VERSION=2.10.0
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
Expand All @@ -46,7 +45,10 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; `
Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; `
Remove-Item GitLfs.zip -Force ; `
& C:\mingit\cmd\git.exe lfs install
& C:\mingit\cmd\git.exe lfs install ; `
$CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
$NewPath = $CurrentPath + ';C:\mingit\cmd' ; `
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath

ARG user=jenkins

Expand Down
6 changes: 3 additions & 3 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Param(
[String] $AdditionalArgs = '',
[String] $Build = '',
[String] $RemotingVersion = '4.3',
[String] $BuildNumber = "1",
[String] $BuildNumber = "6",
[switch] $PushVersions = $false
)

Expand All @@ -30,7 +30,7 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object {
$items = $dir.Split("\")
$jdkVersion = $items[0]
$baseImage = $items[2]
$basicTag = "jdk${jdkVersion}-${baseImage}"
$basicTag = "jdk${jdkVersion}-${baseImage}"
$tags = @( $basicTag )
if($jdkVersion -eq $defaultBuild) {
$tags += $baseImage
Expand All @@ -39,7 +39,7 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object {
$builds[$basicTag] = @{
'Folder' = $dir;
'Tags' = $tags;
}
}
}
}

Expand Down

0 comments on commit acc220e

Please sign in to comment.