From 2032f0b5d13b067527401ebd7788e5f25245c34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Wed, 27 Mar 2024 18:02:17 +0100 Subject: [PATCH 1/4] chore(Windows): add openssh updatecli manifest --- updatecli/updatecli.d/openssh.yml | 56 ++++++++++++++++++++++++++++ windows/nanoserver/Dockerfile | 4 +- windows/windowsservercore/Dockerfile | 4 +- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 updatecli/updatecli.d/openssh.yml diff --git a/updatecli/updatecli.d/openssh.yml b/updatecli/updatecli.d/openssh.yml new file mode 100644 index 00000000..08067b51 --- /dev/null +++ b/updatecli/updatecli.d/openssh.yml @@ -0,0 +1,56 @@ +name: Bump `openssh` 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 `openssh` version + spec: + owner: PowerShell + repository: Win32-OpenSSH + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + transformers: + - trimprefix: "v" + +targets: + setGitLfsVersionWindowsNanoserver: + name: Update the `openssh` Windows version for Windows Nanoserver + kind: dockerfile + spec: + file: windows/nanoserver/Dockerfile + instruction: + keyword: ARG + matcher: OPENSSH_VERSION + scmid: default + setGitLfsVersionWindowsServer: + name: Update the `openssh` Windows version for Windows Core Server + kind: dockerfile + spec: + file: windows/windowsservercore/Dockerfile + instruction: + keyword: ARG + matcher: OPENSSH_VERSION + scmid: default + +actions: + default: + kind: github/pullrequest + title: Bump `openssh` version on Windows to {{ source "lastVersion" }} + scmid: default + spec: + labels: + - enhancement + - openssh + - windows diff --git a/windows/nanoserver/Dockerfile b/windows/nanoserver/Dockerfile index 8e097d5f..44e7176d 100644 --- a/windows/nanoserver/Dockerfile +++ b/windows/nanoserver/Dockerfile @@ -81,9 +81,9 @@ ENV JENKINS_AGENT_USER ${user} ENV JENKINS_AGENT_WORK ${JENKINS_AGENT_WORK} # Setup SSH server -ARG OPENSSH_VERSION=V8.6.0.0p1-Beta +ARG OPENSSH_VERSION=8.6.0.0p1-Beta RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` + $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/v{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` Write-Host "Retrieving $url..." ; ` Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ; ` Expand-Archive c:/openssh.zip 'C:/Program Files' ; ` diff --git a/windows/windowsservercore/Dockerfile b/windows/windowsservercore/Dockerfile index 0d3c2051..9a478235 100644 --- a/windows/windowsservercore/Dockerfile +++ b/windows/windowsservercore/Dockerfile @@ -69,9 +69,9 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl 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 +ARG OPENSSH_VERSION=8.6.0.0p1-Beta RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` + $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/v{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` Write-Host "Retrieving $url..." ; ` Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ; ` Expand-Archive c:/openssh.zip 'C:/Program Files' ; ` From 69c2dace1d462952ea64d0c8885bc00d44428649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Wed, 27 Mar 2024 18:33:10 +0100 Subject: [PATCH 2/4] restore v/V in version (OpenSSH release artifact URLs are a mess!) --- updatecli/updatecli.d/openssh.yml | 2 -- windows/nanoserver/Dockerfile | 4 ++-- windows/windowsservercore/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/updatecli/updatecli.d/openssh.yml b/updatecli/updatecli.d/openssh.yml index 08067b51..d116520a 100644 --- a/updatecli/updatecli.d/openssh.yml +++ b/updatecli/updatecli.d/openssh.yml @@ -21,8 +21,6 @@ sources: repository: Win32-OpenSSH token: "{{ requiredEnv .github.token }}" username: "{{ .github.username }}" - transformers: - - trimprefix: "v" targets: setGitLfsVersionWindowsNanoserver: diff --git a/windows/nanoserver/Dockerfile b/windows/nanoserver/Dockerfile index 44e7176d..8e097d5f 100644 --- a/windows/nanoserver/Dockerfile +++ b/windows/nanoserver/Dockerfile @@ -81,9 +81,9 @@ ENV JENKINS_AGENT_USER ${user} ENV JENKINS_AGENT_WORK ${JENKINS_AGENT_WORK} # Setup SSH server -ARG OPENSSH_VERSION=8.6.0.0p1-Beta +ARG OPENSSH_VERSION=V8.6.0.0p1-Beta RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/v{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` + $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` Write-Host "Retrieving $url..." ; ` Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ; ` Expand-Archive c:/openssh.zip 'C:/Program Files' ; ` diff --git a/windows/windowsservercore/Dockerfile b/windows/windowsservercore/Dockerfile index 9a478235..0d3c2051 100644 --- a/windows/windowsservercore/Dockerfile +++ b/windows/windowsservercore/Dockerfile @@ -69,9 +69,9 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath # Setup SSH server -ARG OPENSSH_VERSION=8.6.0.0p1-Beta +ARG OPENSSH_VERSION=V8.6.0.0p1-Beta RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/v{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` + $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; ` Write-Host "Retrieving $url..." ; ` Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ; ` Expand-Archive c:/openssh.zip 'C:/Program Files' ; ` From d3207f69202de6303c10450c5ac27bf9b15b696a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Fri, 29 Mar 2024 08:44:51 +0100 Subject: [PATCH 3/4] OpenSSH --- updatecli/updatecli.d/openssh.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/updatecli/updatecli.d/openssh.yml b/updatecli/updatecli.d/openssh.yml index d116520a..6ddafb3a 100644 --- a/updatecli/updatecli.d/openssh.yml +++ b/updatecli/updatecli.d/openssh.yml @@ -1,4 +1,4 @@ -name: Bump `openssh` version on Windows +name: Bump OpenSSH version scms: default: @@ -15,7 +15,7 @@ scms: sources: lastVersion: kind: githubrelease - name: Get the latest `openssh` version + name: Get the latest OpenSSH version spec: owner: PowerShell repository: Win32-OpenSSH @@ -23,8 +23,8 @@ sources: username: "{{ .github.username }}" targets: - setGitLfsVersionWindowsNanoserver: - name: Update the `openssh` Windows version for Windows Nanoserver + setGitLfsVersionNanoserver: + name: Update the OpenSSH version for Windows Nanoserver kind: dockerfile spec: file: windows/nanoserver/Dockerfile @@ -32,8 +32,8 @@ targets: keyword: ARG matcher: OPENSSH_VERSION scmid: default - setGitLfsVersionWindowsServer: - name: Update the `openssh` Windows version for Windows Core Server + setGitLfsVersionWindowsServerCore: + name: Update the OpenSSH version for Windows Server Core kind: dockerfile spec: file: windows/windowsservercore/Dockerfile @@ -45,7 +45,7 @@ targets: actions: default: kind: github/pullrequest - title: Bump `openssh` version on Windows to {{ source "lastVersion" }} + title: Bump OpenSSH version to {{ source "lastVersion" }} scmid: default spec: labels: From 5d13c1f251012d36014e3c2146b61b3ebe8f0f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Fri, 29 Mar 2024 08:45:34 +0100 Subject: [PATCH 4/4] bis --- updatecli/updatecli.d/openssh.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/updatecli.d/openssh.yml b/updatecli/updatecli.d/openssh.yml index 6ddafb3a..0db8bbb1 100644 --- a/updatecli/updatecli.d/openssh.yml +++ b/updatecli/updatecli.d/openssh.yml @@ -23,7 +23,7 @@ sources: username: "{{ .github.username }}" targets: - setGitLfsVersionNanoserver: + setOpenSSHVersionNanoserver: name: Update the OpenSSH version for Windows Nanoserver kind: dockerfile spec: @@ -32,7 +32,7 @@ targets: keyword: ARG matcher: OPENSSH_VERSION scmid: default - setGitLfsVersionWindowsServerCore: + setOpenSSHVersionWindowsServerCore: name: Update the OpenSSH version for Windows Server Core kind: dockerfile spec: