mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
33
images/windows/scripts/build/Install-MysqlCli.ps1
Normal file
33
images/windows/scripts/build/Install-MysqlCli.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
################################################################################
|
||||
## File: Install-MysqlCli.ps1
|
||||
## Desc: Install Mysql CLI
|
||||
################################################################################
|
||||
|
||||
# Installing visual c++ redistibutable package.
|
||||
$InstallerName = "vcredist_x64.exe"
|
||||
$InstallerURI = "https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/${InstallerName}"
|
||||
$ArgumentList = ("/install", "/quiet", "/norestart")
|
||||
$InstallerSignatureThumbrint = "3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
|
||||
|
||||
Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList -ExpectedSignature $InstallerSignatureThumbrint
|
||||
|
||||
# Downloading mysql
|
||||
[version]$MysqlVersion = (Get-ToolsetContent).mysql.version
|
||||
$MysqlVersionMajorMinor = $MysqlVersion.ToString(2)
|
||||
|
||||
if ($MysqlVersion.Build -lt 0) {
|
||||
$MysqlVersion = (Invoke-RestMethod -Uri "https://dev.mysql.com/downloads/mysql/${MysqlVersionMajorMinor}.html" -Headers @{ 'User-Agent'='curl/8.4.0' } |
|
||||
Select-String -Pattern "${MysqlVersionMajorMinor}\.\d+").Matches.Value
|
||||
}
|
||||
|
||||
$MysqlVersionFull = $MysqlVersion.ToString()
|
||||
$MysqlVersionUrl = "https://cdn.mysql.com/Downloads/MySQL-${MysqlVersionMajorMinor}/mysql-${MysqlVersionFull}-winx64.msi"
|
||||
|
||||
Install-Binary -Url $MysqlVersionUrl -Name "mysql-${MysqlVersionFull}-winx64.msi" -ExpectedSignature (Get-ToolsetContent).mysql.signature
|
||||
|
||||
# Adding mysql in system environment path
|
||||
$MysqlPath = $(Get-ChildItem -Path "C:\PROGRA~1\MySQL" -Directory)[0].FullName
|
||||
|
||||
Add-MachinePathItem "${MysqlPath}\bin"
|
||||
|
||||
Invoke-PesterTests -TestFile "Databases" -TestName "MySQL"
|
||||
Reference in New Issue
Block a user