diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index bfdee4c3..732c83f5 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -43,7 +43,9 @@ USER ContainerAdministrator ARG GIT_VERSION=2.39.1 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}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` + # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) + if($env:GIT_PATCH_VERSION -eq 1) { $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); } ` + else {$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-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 ; ` diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 90656ce2..51a6c260 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -30,7 +30,9 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ARG GIT_VERSION=2.39.1 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}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` + # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) + if($env:GIT_PATCH_VERSION -eq 1) { $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); } ` + else {$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-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 ; ` diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index 4c8ad0e0..a974356d 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -43,7 +43,9 @@ USER ContainerAdministrator ARG GIT_VERSION=2.39.1 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}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` + # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) + if($env:GIT_PATCH_VERSION -eq 1) { $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); } ` + else {$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-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 ; ` diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index 93fd3e4f..b65cbe63 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -30,7 +30,9 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ARG GIT_VERSION=2.39.1 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}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` + # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) + if($env:GIT_PATCH_VERSION -eq 1) { $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); } ` + else {$url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-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 ; ` diff --git a/updatecli/updatecli.d/git-windows.yml b/updatecli/updatecli.d/git-windows.yml new file mode 100644 index 00000000..5d3514e8 --- /dev/null +++ b/updatecli/updatecli.d/git-windows.yml @@ -0,0 +1,151 @@ +--- +name: Bump Git version on Windows + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastVersion: + kind: githubrelease + name: Get the latest Git version + spec: + owner: "git-for-windows" + repository: "git" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionfilter: + kind: regex + ## Latest stable v{x.y.z}.windows. + pattern: 'v(\d*)\.(\d*)\.(\d*)\.windows\.(\d*)$' + transformers: + - trimprefix: "v" + +targets: + ############# JDK11 Nanoserver 18.09 + setGitVersionJDK11WindowsNanoserver1809: + name: Update the Git Windows version for JDK11 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 11/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK11WindowsNanoserver1809: + name: Update the Git Package Windows patch for JDK11 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 11/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK11 Windows Server Core LTSC2019 + setGitVersionJDK11WindowsServer2019: + name: Update the Git Windows version for JDK11 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 11/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK11WindowsServer2019: + name: Update the Git Package Windows patch for Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 11/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK17 Nanoserver 18.09 + setGitVersionJDK17WindowsNanoserver1809: + name: Update the Git Windows version for JDK17 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 17/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK17WindowsNanoserver1809: + name: Update the Git Package Windows patch for JDK17 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 17/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK17 Windows Server Core LTSC2019 + setGitVersionJDK17WindowsServer2019: + name: Update the Git Windows version for JDK17 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 17/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK17WindowsServer2019: + name: Update the Git Package Windows patch for JDK17 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 17/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + +actions: + default: + kind: github/pullrequest + title: Bump Git version on Windows to {{ source "lastVersion" }} + scmid: default + spec: + labels: + - enhancement + - git + - windows