test ruby 3.1.6

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
This commit is contained in:
Sonu Saha 2024-11-14 15:03:43 +05:30
parent 10ccd4722b
commit 2883203498
2 changed files with 1 additions and 53 deletions

View file

@ -1,58 +1,6 @@
# Stop script execution when a non-terminating error occurs
$ErrorActionPreference = "Stop"
# Function to check if OpenSSL is installed
function Test-OpenSSL {
$openssl = Get-Command "openssl" -ErrorAction SilentlyContinue
if ($openssl) {
Write-Host "+++ OpenSSL is installed."
$openssl_version = openssl version
Write-Host "+++ OpenSSL Version: $openssl_version"
# Check if the installed version is OpenSSL 3.x
if ($openssl_version -like "OpenSSL 3*") {
Write-Host "+++ OpenSSL version 3.x is already installed."
} else {
Write-Host "+++ OpenSSL is installed, but it's not version 3.x. Proceeding to update."
Install-OpenSSL
}
} else {
Write-Host "!!! OpenSSL is not installed or not found in the system PATH."
Write-Host "+++ Installing OpenSSL version 3..."
Install-OpenSSL
}
}
# Function to install OpenSSL version 3
function Install-OpenSSL {
# Define OpenSSL download URL for Windows (64-bit in this case)
$openssl_url = "https://slproweb.com/products/Win32OpenSSL.html"
Write-Host "+++ Downloading OpenSSL version 3..."
# Set to allow insecure SSL connections (bypass certificate check)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Ssl3
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
# Download OpenSSL installer from the official source
$installer_path = "$env:TEMP\Win64OpenSSL-3.0.0.exe"
Invoke-WebRequest -Uri $openssl_url -OutFile $installer_path
# Run the installer (silent install)
Write-Host "+++ Installing OpenSSL..."
Start-Process -FilePath $installer_path -ArgumentList "/silent" -Wait
# Clean up installer
Remove-Item -Path $installer_path -Force
Write-Host "+++ OpenSSL version 3 has been installed successfully."
}
# Run the OpenSSL check and installation process
Test-OpenSSL
# reload Env:PATH to ensure it gets any changes that the install made (e.g. C:\opscode\inspec\bin\ )
$Env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")

View file

@ -5,6 +5,6 @@ train_stable = /^train \((.*)\)/.match(`gem list ^train$ --remote`)[1]
override "train", version: "v#{train_stable}"
override "ruby", version: "3.1.6"
override :openssl, version: "3.0.11"
override :openssl, version: "3.0.11"
override "ruby-msys2-devkit", version: "3.1.6-1"