Skip to content

Commit

Permalink
after refactor but without git-lfs install
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Mar 27, 2024
1 parent fb91ec4 commit 41fae73
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions tests/sshAgent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ TUwLP4n7pK4J2sCIs6fRD5kEYms4BnddXeRuI2fGZHGH70Ci/Q==
-----END RSA PRIVATE KEY-----
"@

$global:GITLFSVERSION = '3.5.1'

Cleanup($global:CONTAINERNAME)

Describe "[$global:IMAGE_NAME] image is present" {
Expand Down
12 changes: 12 additions & 0 deletions updatecli/updatecli.d/git-lfs-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ sources:
username: "{{ .github.username }}"
versionfilter:
kind: semver
transformers:
- trimprefix: "v"

targets:
setGitLfsVersionWindowsNanoserver:
Expand All @@ -43,6 +45,16 @@ targets:
keyword: ARG
matcher: GIT_LFS_VERSION
scmid: default
setGitLfsVersionTests:
name: Update the `git-lfs` Windows version in tests
kind: file
spec:
file: tests/sshAgent.Tests.ps1
matchpattern: >
global:GITLFSVERSION =(.*)
replacepattern: >
global:GITLFSVERSION = '{{ source "lastVersion" }}'
scmid: default

actions:
default:
Expand Down
7 changes: 5 additions & 2 deletions windows/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ ENV WindowsPATH="C:\Windows\system32;C:\Windows"
ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd"

# Install git-lfs
ARG GIT_LFS_VERSION=v3.1.4
ARG GIT_LFS_VERSION=3.4.1
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-lfs/git-lfs/releases/download/{0}/git-lfs-windows-amd64-{0}.zip' -f $env:GIT_LFS_VERSION) ; `
$url = $('https://github.com/git-lfs/git-lfs/releases/download/v{0}/git-lfs-windows-amd64-v{0}.zip' -f $env:GIT_LFS_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; `
Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; `
$gitLfsFolder = 'c:\mingit\mingw64\bin\git-lfs-{0}' -f $env:GIT_LFS_VERSION ; `
Move-Item -Path "${gitLfsFolder}\git-lfs.exe" -Destination c:\mingit\mingw64\bin\ ; `
Remove-Item -Path $gitLfsFolder -Recurse -Force ; `
Remove-Item GitLfs.zip -Force ; `
& C:\mingit\cmd\git.exe lfs install

Expand Down
13 changes: 8 additions & 5 deletions windows/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Remove-Item mingit.zip -Force

# Install git-lfs
ARG GIT_LFS_VERSION=v3.1.4
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
ARG GIT_LFS_VERSION=3.4.1
RUN $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
$NewPath = $CurrentPath + ';{0}\bin;C:\mingit\cmd' -f $env:JAVA_HOME ; `
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = $('https://github.com/git-lfs/git-lfs/releases/download/{0}/git-lfs-windows-amd64-{0}.zip' -f $env:GIT_LFS_VERSION) ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; `
Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; `
$gitLfsFolder = 'c:\mingit\mingw64\bin\git-lfs-{0}' -f $env:GIT_LFS_VERSION ; `
Move-Item -Path "${gitLfsFolder}\git-lfs.exe" -Destination c:\mingit\mingw64\bin\ ; `
Remove-Item -Path $gitLfsFolder -Recurse -Force ; `
Remove-Item GitLfs.zip -Force ; `
& C:\mingit\cmd\git.exe lfs install ; `
$CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
$NewPath = $CurrentPath + ';{0}\bin;C:\mingit\cmd' -f $env:JAVA_HOME ; `
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath

# Setup SSH server
ARG OPENSSH_VERSION=V8.6.0.0p1-Beta
Expand Down

0 comments on commit 41fae73

Please sign in to comment.