From 36fb92995ab1a08dbcb8b7e7345b91c98ec9d9f1 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 21 Sep 2020 17:16:22 +0300 Subject: [PATCH 01/39] add build vm assets --- .../macos/provision/assets/select-xamarin.sh | 22 +++++++++++++++++++ .../provision/configuration/finalize-vm.sh | 6 +++++ images/macos/templates/macOS-10.13.json | 5 +++++ images/macos/templates/macOS-10.14.json | 5 +++++ images/macos/templates/macOS-10.15.json | 5 +++++ images/macos/templates/macOS-11.0.json | 5 +++++ 6 files changed, 48 insertions(+) create mode 100644 images/macos/provision/assets/select-xamarin.sh diff --git a/images/macos/provision/assets/select-xamarin.sh b/images/macos/provision/assets/select-xamarin.sh new file mode 100644 index 00000000..45adc969 --- /dev/null +++ b/images/macos/provision/assets/select-xamarin.sh @@ -0,0 +1,22 @@ +#!/bin/bash +if [ -z "$1" ]; then + echo "No Xamarin SDK specified." + exit 0 +fi + +XAMARIN_SDK=$1 + +echo "Set Xamarin SDK to ${XAMARIN_SDK}" +FOLDERS_LIST=( + '/Library/Frameworks/Mono.framework/Versions' + '/Library/Frameworks/Xamarin.iOS.framework/Versions' + '/Library/Frameworks/Xamarin.Android.framework/Versions' + '/Library/Frameworks/Xamarin.Mac.framework/Versions' + ) + +for FOLDER in "${FOLDERS_LIST[@]}" +do + echo "Set Current folder for ${FOLDER}" + sudo rm -f ${FOLDER}/Current + sudo ln -s ${FOLDER}/${XAMARIN_SDK} ${FOLDER}/Current +done \ No newline at end of file diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index b01b3c23..90abf20a 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -12,6 +12,12 @@ fi # Put documentation to $HOME root cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/ +# Put build vm assets scripts to proper directory +sudo mkdir -p /usr/local/opt/$USER/scripts +sudo chmod ugo+rwx /usr/local/opt/$USER/scripts +sudo chown $USER:admin /usr/local/opt/$USER +mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts + # Clean up npm cache which collected during image-generation # we have to do that here because `npm install` is run in a few different places during image-generation npm cache clean --force diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index 2190a6b4..d1737ac5 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 269ffa71..ba6a0add 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 3dcc3d33..468f02e9 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index 6da9df38..f270fc43 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -43,6 +43,11 @@ "type": "shell", "inline": "mkdir ~/image-generation" }, + { + "type": "file", + "source": "./provision/assets", + "destination": "~/image-generation/" + }, { "type": "file", "source": "./tests", From a5e3159c62c8f2ce4e691ba1290b35024dfebec5 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 16:18:15 +0300 Subject: [PATCH 02/39] replace git for windows internal tools --- images/win/Windows2016-Azure.json | 20 +++++----- images/win/Windows2019-Azure.json | 33 ++++++--------- images/win/scripts/Installers/Install-Git.ps1 | 4 +- .../win/scripts/Installers/Install-Msys2.ps1 | 40 +++++++++---------- .../scripts/Installers/Post-Deployment.ps1 | 19 +++++++++ images/win/scripts/Tests/Git.Tests.ps1 | 2 +- 6 files changed, 62 insertions(+), 56 deletions(-) create mode 100644 images/win/scripts/Installers/Post-Deployment.ps1 diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 6aa1423c..fa1352c8 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -235,6 +235,14 @@ "{{ template_dir }}/scripts/Installers/Update-AndroidSDK.ps1" ] }, + { + "type": "powershell", + "elevated_user": "SYSTEM", + "elevated_password": "", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -290,15 +298,6 @@ "{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1" ] }, - - { - "type": "powershell", - "elevated_user": "SYSTEM", - "elevated_password": "", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -385,7 +384,8 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1", - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", + "{{ template_dir }}/scripts/Installers/Post-Deployment.ps1" ] }, { diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 515caba9..351ea5b7 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -249,6 +249,14 @@ ] }, + { + "type": "powershell", + "elevated_user": "SYSTEM", + "elevated_password": "", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -276,14 +284,6 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, - { - "type": "powershell", - "elevated_user": "SYSTEM", - "elevated_password": "", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -382,19 +382,10 @@ { "type": "powershell", "scripts":[ - "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Run-NGen.ps1" + "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1", + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", + "{{ template_dir }}/scripts/Installers/Run-NGen.ps1", + "{{ template_dir }}/scripts/Installers/Post-Deployment.ps1" ] }, { diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index 2a5ea925..701cf6c4 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -28,7 +28,7 @@ Install-Binary -Url $downloadUrl ` "/SP-", ` "/CLOSEAPPLICATIONS", ` "/RESTARTAPPLICATIONS", ` - "/o:PathOption=CmdTools", ` + "/o:PathOption=Cmd", ` "/o:BashTerminalOption=ConHost", ` "/o:EnableSymlinks=Enabled", ` "/COMPONENTS=gitlfs") @@ -38,7 +38,5 @@ Choco-Install -PackageName hub # Disable GCM machine-wide [Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine) -Add-MachinePathItem "C:\Program Files\Git\bin" - Invoke-PesterTests -TestFile "Git" -TestName "Git" Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI" diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index f0da3850..919fd171 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -9,35 +9,22 @@ $dash = "-" * 40 -$origPath = $env:PATH -$gitPath = "$env:ProgramFiles\Git" - -$msys2_release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest" - -$msys2Uri = ((Invoke-RestMethod $msys2_release).assets | Where-Object { +# Downloading msys2 +$msys2Release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest" +$msys2Uri = ((Invoke-RestMethod $msys2Release).assets | Where-Object { $_.name -match "x86_64" -and $_.name.EndsWith("tar.xz") }).browser_download_url - -# Download the latest msys2 x86_64, filename includes release date -Write-Host "Starting msys2 download using $($msys2Uri.split('/')[-1])" $msys2File = Start-DownloadWithRetry -Url $msys2Uri -Write-Host "Finished download" - -# nix style path for tar -$msys2FileU = "/$msys2File".replace(':', '').replace('\', '/') - -# Git tar needs exe's from mingw64\bin -$env:PATH = "$gitPath\usr\bin;$gitPath\mingw64\bin;$origPath" - -$tar = "$gitPath\usr\bin\tar.exe" # extract tar.xz to C:\ Write-Host "Starting msys2 extraction" -&$tar -xJf $msys2FileU -C /c/ -Remove-Item $msys2File +$tempPath = Join-Path $env:Temp msys +Extract-7Zip -Path $msys2File -DestinationPath $tempPath +$tarPath = Resolve-Path $tempPath\msys*.tar +Extract-7Zip -Path $tarPath -DestinationPath C:\ Write-Host "Finished extraction" # Add msys2 bin tools folders to PATH temporary -$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$origPath" +$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$env:PATH" Write-Host "`n$dash bash pacman-key --init" bash.exe -c "pacman-key --init 2>&1" @@ -88,4 +75,15 @@ pacman.exe -Q | grep -v ^mingw-w64- Write-Host "`nMSYS2 installation completed" +# Environment +# add C:\msys64\mingw64\bin and C:\msys64\usr\bin to PATH +# C:\msys64\mingw64\bin add after C:\Windows\System32 to not replace built-in tar.exe +$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' +$pathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' +$pathValue += ";C:\msys64\mingw64\bin;C:\msys64\usr\bin" +Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $pathValue + +# Rename python +Rename-Item "C:\msys64\usr\bin\python.exe" -NewName "_python.exe" + Invoke-PesterTests -TestFile "MSYS2" diff --git a/images/win/scripts/Installers/Post-Deployment.ps1 b/images/win/scripts/Installers/Post-Deployment.ps1 new file mode 100644 index 00000000..c514800d --- /dev/null +++ b/images/win/scripts/Installers/Post-Deployment.ps1 @@ -0,0 +1,19 @@ +# Create shells folder +$shellPath = "C:\shells" +$null = New-Item -Path $shellPath -ItemType Directory + +# MSYS2 <--> C:\msys64\usr\bin\bash.exe +$null = New-Item -ItemType SymbolicLink -Path "$shellPath\msys2.exe" -Target "C:\msys64\usr\bin\bash.exe" + +# sh and bash <--> C:\msys64\usr\bin\bash.exe +$null = New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\usr\bin\bash.exe" +$null = New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\usr\bin\sh.exe" + +# winbash <--> C:\Windows\System32\bash.exe +$null = New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" + +# git4bash <--> C:\Program Files\Git\bin\bash.exe +$null = New-Item -ItemType SymbolicLink -Path "$shellPath\git4bash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" + +# Add shells to PATH +Add-MachinePathItem $shellPath \ No newline at end of file diff --git a/images/win/scripts/Tests/Git.Tests.ps1 b/images/win/scripts/Tests/Git.Tests.ps1 index 8dd159fa..e7675ee0 100644 --- a/images/win/scripts/Tests/Git.Tests.ps1 +++ b/images/win/scripts/Tests/Git.Tests.ps1 @@ -1,5 +1,5 @@ Describe "Git" { - $gitTools = 'bash', 'awk', 'git', 'git-lfs' + $gitTools = 'git', 'git-lfs' $gitTestCases = $gitTools | ForEach-Object { @{ toolName = $_ From 56ea603436fd9f51c33c97cf61b96d914ff8547f Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 16:28:42 +0300 Subject: [PATCH 03/39] merge edge fix --- images/win/scripts/Installers/Install-Edge.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Install-Edge.ps1 b/images/win/scripts/Installers/Install-Edge.ps1 index ebb7871b..1f4ce0ae 100644 --- a/images/win/scripts/Installers/Install-Edge.ps1 +++ b/images/win/scripts/Installers/Install-Edge.ps1 @@ -24,7 +24,14 @@ $EdgeDriverVersionFile = Start-DownloadWithRetry -Url $EdgeDriverVersionUrl -Nam Write-Host "Download Microsoft Edge WebDriver..." $EdgeDriverLatestVersion = Get-Content -Path $EdgeDriverVersionFile $EdgeDriverArchName = "edgedriver_win64.zip" -$EdgeDriverDownloadUrl="https://msedgedriver.azureedge.net/${EdgeDriverLatestVersion}/${EdgeDriverArchName}" +# A temporary workaround to install the previous driver version because 85.0.564.60 for win64 doesn't exist +if ($EdgeDriverLatestVersion -eq "85.0.564.60") +{ + $EdgeDriverLatestVersion = "85.0.564.51" + Set-Content -Path $EdgeDriverVersionFile -Value $EdgeDriverLatestVersion +} + +$EdgeDriverDownloadUrl = "https://msedgedriver.azureedge.net/${EdgeDriverLatestVersion}/${EdgeDriverArchName}" $EdgeDriverArchPath = Start-DownloadWithRetry -Url $EdgeDriverDownloadUrl -Name $EdgeDriverArchName From 2148a2bd2fdbe4b88b42097ae839e2e9dd82f8da Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 18:22:15 +0300 Subject: [PATCH 04/39] adding pester tests --- images/win/Windows2016-Azure.json | 8 ++-- images/win/Windows2019-Azure.json | 8 ++-- .../scripts/Installers/Configure-Shell.ps1 | 19 ++++++++ .../scripts/Installers/Post-Deployment.ps1 | 19 -------- images/win/scripts/Tests/Shell.Tests.ps1 | 43 +++++++++++++++++++ 5 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 images/win/scripts/Installers/Configure-Shell.ps1 delete mode 100644 images/win/scripts/Installers/Post-Deployment.ps1 create mode 100644 images/win/scripts/Tests/Shell.Tests.ps1 diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index fa1352c8..442218d3 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -325,7 +325,9 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", - "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1" + "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1", + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", + "{{ template_dir }}/scripts/Installers/Configure-Shell.ps1" ], "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" @@ -383,9 +385,7 @@ { "type": "powershell", "scripts":[ - "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1", - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", - "{{ template_dir }}/scripts/Installers/Post-Deployment.ps1" + "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, { diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 351ea5b7..0e3d180b 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -324,7 +324,9 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", - "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1" + "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1", + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", + "{{ template_dir }}/scripts/Installers/Configure-Shell.ps1" ], "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" @@ -383,9 +385,7 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1", - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", - "{{ template_dir }}/scripts/Installers/Run-NGen.ps1", - "{{ template_dir }}/scripts/Installers/Post-Deployment.ps1" + "{{ template_dir }}/scripts/Installers/Run-NGen.ps1" ] }, { diff --git a/images/win/scripts/Installers/Configure-Shell.ps1 b/images/win/scripts/Installers/Configure-Shell.ps1 new file mode 100644 index 00000000..6bb7bc50 --- /dev/null +++ b/images/win/scripts/Installers/Configure-Shell.ps1 @@ -0,0 +1,19 @@ +# Create shells folder +$shellPath = "C:\shells" +New-Item -Path $shellPath -ItemType Directory | Out-Null + +# sh and bash <--> C:\msys64\usr\bin\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null +New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\usr\bin\sh.exe" | Out-Null + +# winbash <--> C:\Windows\System32\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null + +# git4bash <--> C:\Program Files\Git\bin\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\git4bash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null + +# MSYS2 <--> C:\msys64\usr\bin\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\msys2.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null + +# Add shells to PATH +Add-MachinePathItem $shellPath \ No newline at end of file diff --git a/images/win/scripts/Installers/Post-Deployment.ps1 b/images/win/scripts/Installers/Post-Deployment.ps1 deleted file mode 100644 index c514800d..00000000 --- a/images/win/scripts/Installers/Post-Deployment.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# Create shells folder -$shellPath = "C:\shells" -$null = New-Item -Path $shellPath -ItemType Directory - -# MSYS2 <--> C:\msys64\usr\bin\bash.exe -$null = New-Item -ItemType SymbolicLink -Path "$shellPath\msys2.exe" -Target "C:\msys64\usr\bin\bash.exe" - -# sh and bash <--> C:\msys64\usr\bin\bash.exe -$null = New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\usr\bin\bash.exe" -$null = New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\usr\bin\sh.exe" - -# winbash <--> C:\Windows\System32\bash.exe -$null = New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" - -# git4bash <--> C:\Program Files\Git\bin\bash.exe -$null = New-Item -ItemType SymbolicLink -Path "$shellPath\git4bash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" - -# Add shells to PATH -Add-MachinePathItem $shellPath \ No newline at end of file diff --git a/images/win/scripts/Tests/Shell.Tests.ps1 b/images/win/scripts/Tests/Shell.Tests.ps1 new file mode 100644 index 00000000..e7645f2e --- /dev/null +++ b/images/win/scripts/Tests/Shell.Tests.ps1 @@ -0,0 +1,43 @@ +Describe "Shell" { + $shellTestCases = @( + @{Name = "C:\shells\bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"}, + @{Name = "C:\shells\sh.exe"; Target = "C:\msys64\usr\bin\sh.exe"}, + @{Name = "C:\shells\winbash.exe"; Target = "$env:SystemRoot\System32\bash.exe"}, + @{Name = "C:\shells\git4bash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"}, + @{Name = "C:\shells\msys2.exe"; Target = "C:\msys64\usr\bin\bash.exe"} + ) + + $pathTestCases = @( + @{Path = "C:\shells"}, + @{Path = "C:\msys64\mingw64\bin"}, + @{Path = "C:\msys64\usr\bin"} + ) + + It "Default bash.exe from MSYS2" { + (Get-Command bash).Path | Should -BeExactly "C:\shells\bash.exe" + } + + It "Default sh.exe from MSYS2" { + (Get-Command sh).Path | Should -BeExactly "C:\shells\sh.exe" + } + + It "Folder C:\shells exists" { + "C:\shells" | Should -Exist + } + + It "C:\Windows\System32 before C:\msys64\mingw64\bin and C:\msys64\usr\bin" { + $path = $env:Path.Split(";").ToLower() + $indexOfSystem32 = $path.IndexOf("c:\windows\system32") + + $path.IndexOf("c:\msys64\mingw64\bin") | Should -BeGreaterThan $indexOfSystem32 + $path.IndexOf("c:\msys64\usr\bin") | Should -BeGreaterThan $indexOfSystem32 + } + + It " target to " -TestCases $shellTestCases { + (Get-Item $Name).Target | Should -BeExactly $Target + } + + It " is in PATH" -TestCases $pathTestCases { + $env:Path.Split(";") | Should -Contain $Path + } +} \ No newline at end of file From ed62416e84b73fc13ffff7b61e60a0cbfff25437 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 23 Sep 2020 10:41:23 +0300 Subject: [PATCH 05/39] fix pester tests --- images/win/scripts/Installers/Configure-Shell.ps1 | 10 +++++++--- images/win/scripts/Installers/Install-Msys2.ps1 | 12 +++--------- images/win/scripts/Tests/Shell.Tests.ps1 | 11 +++++++++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/images/win/scripts/Installers/Configure-Shell.ps1 b/images/win/scripts/Installers/Configure-Shell.ps1 index 6bb7bc50..1eabdc08 100644 --- a/images/win/scripts/Installers/Configure-Shell.ps1 +++ b/images/win/scripts/Installers/Configure-Shell.ps1 @@ -6,14 +6,18 @@ New-Item -Path $shellPath -ItemType Directory | Out-Null New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\usr\bin\sh.exe" | Out-Null -# winbash <--> C:\Windows\System32\bash.exe -New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null +# WSL is available on Windows Server 2019 +if (Test-IsWin19) +{ + # winbash <--> C:\Windows\System32\bash.exe + New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null +} # git4bash <--> C:\Program Files\Git\bin\bash.exe New-Item -ItemType SymbolicLink -Path "$shellPath\git4bash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null # MSYS2 <--> C:\msys64\usr\bin\bash.exe -New-Item -ItemType SymbolicLink -Path "$shellPath\msys2.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null +New-Item -ItemType SymbolicLink -Path "$shellPath\msys2bash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null # Add shells to PATH Add-MachinePathItem $shellPath \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index 919fd171..b077f5cd 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -12,15 +12,12 @@ $dash = "-" * 40 # Downloading msys2 $msys2Release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest" $msys2Uri = ((Invoke-RestMethod $msys2Release).assets | Where-Object { - $_.name -match "x86_64" -and $_.name.EndsWith("tar.xz") }).browser_download_url + $_.name -match "x86_64" -and $_.name.EndsWith("sfx.exe") }).browser_download_url $msys2File = Start-DownloadWithRetry -Url $msys2Uri -# extract tar.xz to C:\ +# extract sfx.exe to C:\ Write-Host "Starting msys2 extraction" -$tempPath = Join-Path $env:Temp msys -Extract-7Zip -Path $msys2File -DestinationPath $tempPath -$tarPath = Resolve-Path $tempPath\msys*.tar -Extract-7Zip -Path $tarPath -DestinationPath C:\ +& $msys2File -y -oC:\ Write-Host "Finished extraction" # Add msys2 bin tools folders to PATH temporary @@ -83,7 +80,4 @@ $pathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' $pathValue += ";C:\msys64\mingw64\bin;C:\msys64\usr\bin" Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $pathValue -# Rename python -Rename-Item "C:\msys64\usr\bin\python.exe" -NewName "_python.exe" - Invoke-PesterTests -TestFile "MSYS2" diff --git a/images/win/scripts/Tests/Shell.Tests.ps1 b/images/win/scripts/Tests/Shell.Tests.ps1 index e7645f2e..eec1a3bf 100644 --- a/images/win/scripts/Tests/Shell.Tests.ps1 +++ b/images/win/scripts/Tests/Shell.Tests.ps1 @@ -2,9 +2,8 @@ Describe "Shell" { $shellTestCases = @( @{Name = "C:\shells\bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"}, @{Name = "C:\shells\sh.exe"; Target = "C:\msys64\usr\bin\sh.exe"}, - @{Name = "C:\shells\winbash.exe"; Target = "$env:SystemRoot\System32\bash.exe"}, @{Name = "C:\shells\git4bash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"}, - @{Name = "C:\shells\msys2.exe"; Target = "C:\msys64\usr\bin\bash.exe"} + @{Name = "C:\shells\msys2bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"} ) $pathTestCases = @( @@ -13,6 +12,8 @@ Describe "Shell" { @{Path = "C:\msys64\usr\bin"} ) + $IsWin16 = Test-IsWin16 + It "Default bash.exe from MSYS2" { (Get-Command bash).Path | Should -BeExactly "C:\shells\bash.exe" } @@ -33,6 +34,12 @@ Describe "Shell" { $path.IndexOf("c:\msys64\usr\bin") | Should -BeGreaterThan $indexOfSystem32 } + It "C:\shells\winbash.exe target to $env:SystemRoot\System32\bash.exe" -Skip:$IsWin16 { + $Name = "C:\shells\winbash.exe" + $Target = "$env:SystemRoot\System32\bash.exe" + (Get-Item $Name).Target | Should -BeExactly $Target + } + It " target to " -TestCases $shellTestCases { (Get-Item $Name).Target | Should -BeExactly $Target } From b6d36cae6103cc622c55c34af25f74b2c238ff52 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 23 Sep 2020 11:45:36 +0300 Subject: [PATCH 06/39] consistency shell naming --- images/win/scripts/Installers/Configure-Shell.ps1 | 8 ++++---- images/win/scripts/Tests/Shell.Tests.ps1 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/images/win/scripts/Installers/Configure-Shell.ps1 b/images/win/scripts/Installers/Configure-Shell.ps1 index 1eabdc08..8eb163bc 100644 --- a/images/win/scripts/Installers/Configure-Shell.ps1 +++ b/images/win/scripts/Installers/Configure-Shell.ps1 @@ -13,11 +13,11 @@ if (Test-IsWin19) New-Item -ItemType SymbolicLink -Path "$shellPath\winbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null } -# git4bash <--> C:\Program Files\Git\bin\bash.exe -New-Item -ItemType SymbolicLink -Path "$shellPath\git4bash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null +# gitbash <--> C:\Program Files\Git\bin\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\gitbash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null -# MSYS2 <--> C:\msys64\usr\bin\bash.exe -New-Item -ItemType SymbolicLink -Path "$shellPath\msys2bash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null +# msysbash <--> C:\msys64\usr\bin\bash.exe +New-Item -ItemType SymbolicLink -Path "$shellPath\msysbash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null # Add shells to PATH Add-MachinePathItem $shellPath \ No newline at end of file diff --git a/images/win/scripts/Tests/Shell.Tests.ps1 b/images/win/scripts/Tests/Shell.Tests.ps1 index eec1a3bf..915940e2 100644 --- a/images/win/scripts/Tests/Shell.Tests.ps1 +++ b/images/win/scripts/Tests/Shell.Tests.ps1 @@ -2,8 +2,8 @@ Describe "Shell" { $shellTestCases = @( @{Name = "C:\shells\bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"}, @{Name = "C:\shells\sh.exe"; Target = "C:\msys64\usr\bin\sh.exe"}, - @{Name = "C:\shells\git4bash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"}, - @{Name = "C:\shells\msys2bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"} + @{Name = "C:\shells\gitbash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"}, + @{Name = "C:\shells\msysbash.exe"; Target = "C:\msys64\usr\bin\bash.exe"} ) $pathTestCases = @( From c076e851f4f23cd0802e885996d1cbf09c1805ef Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 23 Sep 2020 13:30:07 +0300 Subject: [PATCH 07/39] make scripts executable --- images/macos/provision/configuration/finalize-vm.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index 90abf20a..3b7f1dc6 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -18,6 +18,12 @@ sudo chmod ugo+rwx /usr/local/opt/$USER/scripts sudo chown $USER:admin /usr/local/opt/$USER mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts +executableScripts=$(ls /usr/local/opt/$USER/scripts | grep "*\.sh") +for script in $executableScripts +do + chmod +x $script +done + # Clean up npm cache which collected during image-generation # we have to do that here because `npm install` is run in a few different places during image-generation npm cache clean --force From c189d7eac048a0f7bbfa7364f8c72a12cba1b2fc Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 23 Sep 2020 13:37:15 +0300 Subject: [PATCH 08/39] rename select-xamarin to selec-xamarin-sdk --- .../provision/assets/{select-xamarin.sh => select-xamarin-sdk.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename images/macos/provision/assets/{select-xamarin.sh => select-xamarin-sdk.sh} (100%) diff --git a/images/macos/provision/assets/select-xamarin.sh b/images/macos/provision/assets/select-xamarin-sdk.sh similarity index 100% rename from images/macos/provision/assets/select-xamarin.sh rename to images/macos/provision/assets/select-xamarin-sdk.sh From c5aa898cd6a59686a559a20be464929a98af2095 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 23 Sep 2020 14:13:02 +0300 Subject: [PATCH 09/39] change to find search --- images/macos/provision/configuration/finalize-vm.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index 3b7f1dc6..77902ea4 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -18,11 +18,7 @@ sudo chmod ugo+rwx /usr/local/opt/$USER/scripts sudo chown $USER:admin /usr/local/opt/$USER mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts -executableScripts=$(ls /usr/local/opt/$USER/scripts | grep "*\.sh") -for script in $executableScripts -do - chmod +x $script -done +find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \; # Clean up npm cache which collected during image-generation # we have to do that here because `npm install` is run in a few different places during image-generation From cdc9d19df849adcce5dec98866e65f3c7359100b Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 25 Sep 2020 11:54:37 +0300 Subject: [PATCH 10/39] msys2 after openssl --- images/win/Windows2016-Azure.json | 16 ++++++++-------- images/win/Windows2019-Azure.json | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 442218d3..8d47c462 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -235,14 +235,6 @@ "{{ template_dir }}/scripts/Installers/Update-AndroidSDK.ps1" ] }, - { - "type": "powershell", - "elevated_user": "SYSTEM", - "elevated_password": "", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -270,6 +262,14 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, + { + "type": "powershell", + "elevated_user": "SYSTEM", + "elevated_password": "", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" + ] + }, { "type": "windows-shell", "inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"] diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 0e3d180b..b1500edb 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -249,14 +249,6 @@ ] }, - { - "type": "powershell", - "elevated_user": "SYSTEM", - "elevated_password": "", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -284,6 +276,14 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, + { + "type": "powershell", + "elevated_user": "SYSTEM", + "elevated_password": "", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" + ] + }, { "type": "powershell", "scripts":[ From caefc77d7ad916c0e56d763a4adbd7b435061109 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 28 Sep 2020 15:08:08 +0300 Subject: [PATCH 11/39] update msys2 notes --- .../scripts/SoftwareReport/SoftwareReport.Common.psm1 | 6 ++++++ .../SoftwareReport/SoftwareReport.Generator.ps1 | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 05b101aa..45a9a4ac 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -271,6 +271,12 @@ function Get-PacmanVersion { return "- Pacman $pacmanVersion" } +function Get-ShellTarget { + $shells = Get-ChildItem C:\shells -File | Select-Object @{n="Name";e={ + if ($_.Name -eq 'bash.exe') {"$($_.Name) (Default)"} else {$_.Name}}},@{n="Target";e={$_.Target[0]}} | Sort-Object Name + $shells | New-MDTable -Columns ([ordered]@{Name = "left"; Target = "left";}) +} + function Get-YAMLLintVersion { yamllint --version } \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 2f45ecde..4a24d73e 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -148,14 +148,22 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-SeleniumWebDriverVersion -Driver "iexplorer") ) +$markdown += New-MDHeader "Shells" -Level 3 +$markdown += Get-ShellTarget +$markdown += New-MDNewLine + $markdown += New-MDHeader "MSYS2" -Level 3 $markdown += Get-PacmanVersion $markdown += New-MDNewLine +$markdown += New-MDHeader "Notes:" -Level 5 $markdown += @' ``` Location: C:\msys64 -Note: MSYS2 is pre-installed on image but not added to PATH. +1. MSYS2 is pre-installed on image +2. C:\msys64\mingw64\bin is added to PATH and has lower precedence than C:\Windows\System32 +3. C:\msys64\usr\bin is added to PATH and has lower precedence than C:\Windows\System32 +4. Default bash.exe shell is set to the C:\msys64\usr\bin\bash.exe ``` '@ $markdown += New-MDNewLine From 55b69ec4b48c3ef16642484919051035eb12feb0 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 10:33:53 +0300 Subject: [PATCH 12/39] remove duplicate msys2 record --- images/win/Windows2016-Azure.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index be64ae47..e20404c8 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -266,14 +266,6 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, - { - "type": "powershell", - "elevated_user": "SYSTEM", - "elevated_password": "", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" - ] - }, { "type": "windows-shell", "inline": [ From fe810160ee404f091d1ca84173477cb89bbd8d7c Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 19:08:14 +0300 Subject: [PATCH 13/39] fix target --- images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 45a9a4ac..0ca95ee7 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -273,7 +273,8 @@ function Get-PacmanVersion { function Get-ShellTarget { $shells = Get-ChildItem C:\shells -File | Select-Object @{n="Name";e={ - if ($_.Name -eq 'bash.exe') {"$($_.Name) (Default)"} else {$_.Name}}},@{n="Target";e={$_.Target[0]}} | Sort-Object Name + $name = $_.Name + if ($name -eq 'bash.exe') {"$name (Default)"} else {$name}}},@{n="Target";e={@($_.Target)[0]}} | Sort-Object Name $shells | New-MDTable -Columns ([ordered]@{Name = "left"; Target = "left";}) } From 5d96d50f595c66e45212350b93ab77380d7b58fa Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 09:29:37 +0300 Subject: [PATCH 14/39] added pipx and yamllint --- images/macos/provision/core/commonutils.sh | 1 - images/macos/provision/core/pipx-packages.sh | 25 +++++++++++++++++++ images/macos/provision/core/python.sh | 14 ++++++++++- .../SoftwareReport.Common.psm1 | 4 +++ .../SoftwareReport.Generator.ps1 | 2 ++ images/macos/templates/macOS-10.14.json | 7 ++++++ images/macos/templates/macOS-10.15.json | 7 ++++++ images/macos/templates/macOS-11.0.json | 7 ++++++ images/macos/toolsets/toolset-10.14.json | 6 +++++ images/macos/toolsets/toolset-10.15.json | 14 ++++++++--- images/macos/toolsets/toolset-11.0.json | 10 ++++++-- 11 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 images/macos/provision/core/pipx-packages.sh diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 9b32d5c2..5b3522f5 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -22,7 +22,6 @@ binst_common_utils=( github/gh/gh p7zip ant - yamllint aria2 ) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh new file mode 100644 index 00000000..c01a4b97 --- /dev/null +++ b/images/macos/provision/core/pipx-packages.sh @@ -0,0 +1,25 @@ +source ~/utils/utils.sh + +export PATH="$PATH:/opt/pipx_bin" + +toolset=get_toolset_path +pipx_packages=$(jq -r ".pipx[] .package" $toolset) + +for package in $pipx_packages; do + python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset) + if [ "$python_version" != "null" ]; then + python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" + echo "Install $package into python $python_path" + pipx install $package --python $python_path + else + echo "Install $package into default python" + pipx install $package + fi + + # Run tests to determine that the software installed as expected + cmd=$(jq -r ".pipx[] | select(.package == \"$package\") .cmd" $toolset) + if ! command -v $cmd; then + echo "$package was not installed" + exit 1 + fi +done \ No newline at end of file diff --git a/images/macos/provision/core/python.sh b/images/macos/provision/core/python.sh index 41488642..5bda9ef3 100755 --- a/images/macos/provision/core/python.sh +++ b/images/macos/provision/core/python.sh @@ -7,7 +7,19 @@ echo "Brew Installing Python 3" /usr/local/bin/brew install python3 echo "Brew Installing Python 2" -# Create local tap with formula due to python2 formula depreciation +# Create local tap with formula due to python2 formula depreciation /usr/local/bin/brew tap-new local/python2 FORMULA_PATH=$(/usr/local/bin/brew extract python@2 local/python2 | grep "Homebrew/Library/Taps") /usr/local/bin/brew install $FORMULA_PATH + +echo "Installing pipx" +export PIPX_BIN_DIR=/opt/pipx_bin +export PIPX_HOME=/opt/pipx + +brew install pipx +python3 -m pipx ensurepath + +echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" +echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" +echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc" + diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index c3fe7517..5c518d16 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -96,6 +96,10 @@ function Get-PipVersion { return "${versionPart1} ${versionPart2} ${versionPart3}" } +function Get-PipxVersion { + return "Pipx $(pipx --version 2> $null)" +} + function Get-NVMNodeVersionList { $nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh" $nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true" diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 87c94459..40214d7a 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -81,6 +81,7 @@ $npmVersion = Run-Command "npm --version" $yarnVersion = Run-Command "yarn --version" $nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2 $pip3Version = Get-PipVersion -Version 3 +$pipxVersion = Get-PipxVersion $condaVersion = Invoke-Expression "conda --version" $rubyGemsVersion = Run-Command "gem --version" $composerVersion = Run-Command "composer --version" | Take-Part -Part 2 @@ -97,6 +98,7 @@ if ($os.IsLessThanBigSur) { $markdown += New-MDList -Style Unordered -Lines @( "Pip ${pip3Version}", + $pipxVersion, $bundlerVersion, "Carthage ${carthageVersion}", "CocoaPods ${cocoaPodsVersion}", diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 269ffa71..3cb0b070 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -196,6 +196,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 3dcc3d33..65a0d12d 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -195,6 +195,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index 6da9df38..c732f799 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -192,6 +192,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/toolsets/toolset-10.14.json b/images/macos/toolsets/toolset-10.14.json index e868f769..fc1d44af 100644 --- a/images/macos/toolsets/toolset-10.14.json +++ b/images/macos/toolsets/toolset-10.14.json @@ -257,5 +257,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index 8497a710..e754bacf 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -26,28 +26,28 @@ "mono":"6.12", "ios": "14.0", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_12_0", "mono":"6.12", "ios": "13.20", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_10_0", "mono":"6.10", "ios": "13.18", "mac": "6.18", - "android": "10.3" + "android": "10.3" }, { "symlink": "6_8_1", "mono":"6.8", "ios": "13.16", "mac": "6.16", - "android": "10.2" + "android": "10.2" }, { "symlink": "6_8_0", @@ -166,5 +166,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index 725da218..8a739f91 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -26,14 +26,14 @@ "mono":"6.12", "ios": "14.0", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_12_0", "mono":"6.12", "ios": "13.20", "mac": "6.20", - "android": "11.0" + "android": "11.0" } ] }, @@ -91,5 +91,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file From 6742dd7a546df5c182a04a552d62ebb6eaaa41b9 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 14:58:13 +0300 Subject: [PATCH 15/39] resolved comments --- images/macos/provision/core/pipx-packages.sh | 9 +-------- images/macos/provision/core/python.sh | 5 ++--- images/macos/tests/Python.Tests.ps1 | 4 ++++ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh index c01a4b97..b755dede 100644 --- a/images/macos/provision/core/pipx-packages.sh +++ b/images/macos/provision/core/pipx-packages.sh @@ -8,18 +8,11 @@ pipx_packages=$(jq -r ".pipx[] .package" $toolset) for package in $pipx_packages; do python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset) if [ "$python_version" != "null" ]; then - python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" + python_path="$HOME/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" echo "Install $package into python $python_path" pipx install $package --python $python_path else echo "Install $package into default python" pipx install $package fi - - # Run tests to determine that the software installed as expected - cmd=$(jq -r ".pipx[] | select(.package == \"$package\") .cmd" $toolset) - if ! command -v $cmd; then - echo "$package was not installed" - exit 1 - fi done \ No newline at end of file diff --git a/images/macos/provision/core/python.sh b/images/macos/provision/core/python.sh index 5bda9ef3..0c4058e3 100755 --- a/images/macos/provision/core/python.sh +++ b/images/macos/provision/core/python.sh @@ -13,11 +13,10 @@ FORMULA_PATH=$(/usr/local/bin/brew extract python@2 local/python2 | grep "Homebr /usr/local/bin/brew install $FORMULA_PATH echo "Installing pipx" -export PIPX_BIN_DIR=/opt/pipx_bin -export PIPX_HOME=/opt/pipx +export PIPX_BIN_DIR=/usr/local/opt/pipx_bin +export PIPX_HOME=/usr/local/opt/pipx brew install pipx -python3 -m pipx ensurepath echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" diff --git a/images/macos/tests/Python.Tests.ps1 b/images/macos/tests/Python.Tests.ps1 index 76cd8941..43dc122a 100644 --- a/images/macos/tests/Python.Tests.ps1 +++ b/images/macos/tests/Python.Tests.ps1 @@ -31,4 +31,8 @@ Describe "Python" { It "Pip 3 is available" { "pip3 --version" | Should -ReturnZeroExitCode } + + It "Pipx is available" { + "pipx --version" | Should -ReturnZeroExitCode + } } \ No newline at end of file From ef1a055d44d3210760ee96ac96ec0c124e72cd68 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 16:20:27 +0300 Subject: [PATCH 16/39] added pipx to 10.13 --- images/macos/templates/macOS-10.13.json | 7 +++++++ images/macos/toolsets/toolset-10.13.json | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index 2190a6b4..2300bf51 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -183,6 +183,13 @@ "./provision/core/pypy.sh" ] }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "inline": [ diff --git a/images/macos/toolsets/toolset-10.13.json b/images/macos/toolsets/toolset-10.13.json index fdb14d08..5157fe47 100644 --- a/images/macos/toolsets/toolset-10.13.json +++ b/images/macos/toolsets/toolset-10.13.json @@ -198,5 +198,11 @@ "3.6" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file From 451598b8c171adf7fea6da3715e7e41cdee0d368 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Fri, 9 Oct 2020 09:43:44 +0300 Subject: [PATCH 17/39] fixed pipx-packages.sh --- images/macos/provision/core/pipx-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh index b755dede..658600fa 100644 --- a/images/macos/provision/core/pipx-packages.sh +++ b/images/macos/provision/core/pipx-packages.sh @@ -2,7 +2,7 @@ source ~/utils/utils.sh export PATH="$PATH:/opt/pipx_bin" -toolset=get_toolset_path +toolset=$(get_toolset_path) pipx_packages=$(jq -r ".pipx[] .package" $toolset) for package in $pipx_packages; do From f1da709f47f9f14aa559501fd260f2dcdc1448de Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Mon, 12 Oct 2020 11:10:02 +0300 Subject: [PATCH 18/39] fixed Get-PipxVersion --- images/macos/software-report/SoftwareReport.Common.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index 5c518d16..7616b81b 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -97,7 +97,8 @@ function Get-PipVersion { } function Get-PipxVersion { - return "Pipx $(pipx --version 2> $null)" + $pipxVersion = Run-Command "pipx --version" -SuppressStderr + return "Pipx $pipxVersion" } function Get-NVMNodeVersionList { From 114da935564e7339abcc111d14e1f0defa5e823e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 20 Oct 2020 13:47:33 +0300 Subject: [PATCH 19/39] rework chrome installation --- images/macos/provision/core/chrome.sh | 4 +++- images/macos/provision/utils/utils.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/core/chrome.sh b/images/macos/provision/core/chrome.sh index 203faee7..aad4fb4d 100644 --- a/images/macos/provision/core/chrome.sh +++ b/images/macos/provision/core/chrome.sh @@ -1,5 +1,7 @@ +source ~/utils/utils.sh + echo "Installing Chrome..." -brew cask install google-chrome +brew_install_ignoring_sha256 "google-chrome" echo "Installing Chrome Driver" brew cask install chromedriver diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 85881c7e..1bca5c8a 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -96,4 +96,15 @@ get_default_xcode_from_toolset() { verlte() { sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1) [ "$1" = "$sortedVersion" ] +} + +brew_install_ignoring_sha256() { + local TOOL_NAME=$1 + + CASK_DIR=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks + chmod a+w "$CASK_DIR/$TOOL_NAME.rb" + SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') + sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" + brew cask install $TOOL_NAME + sed -i '' "s/:no_check/:$SHA/" "$CASK_DIR/$TOOL_NAME.rb" } \ No newline at end of file From edff9f791bade856d31e67e25fa191500d429c96 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 08:33:58 +0300 Subject: [PATCH 20/39] updated json files --- images/macos/templates/macOS-10.13.json | 8 +------- images/macos/templates/macOS-10.14.json | 10 ++-------- images/macos/templates/macOS-10.15.json | 10 ++-------- images/macos/templates/macOS-11.0.json | 10 ++-------- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index aa43650a..9ebd56e6 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -181,13 +181,7 @@ "./provision/core/edge.sh", "./provision/core/firefox.sh", "./provision/core/toolcache-high-sierra.sh", - "./provision/core/pypy.sh" - ] - }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ + "./provision/core/pypy.sh", "./provision/core/pipx-packages.sh" ] }, diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 017bc607..c03cc72a 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -186,7 +186,8 @@ "./provision/core/miniconda.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/toolcache.sh", - "./provision/core/pypy.sh" + "./provision/core/pypy.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -197,13 +198,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index cf225d41..cf49ef57 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -185,7 +185,8 @@ "./provision/core/firefox.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/toolcache.sh", - "./provision/core/pypy.sh" + "./provision/core/pypy.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -196,13 +197,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index d1f54d31..585a9354 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -181,7 +181,8 @@ "./provision/core/chrome.sh", "./provision/core/edge.sh", "./provision/core/firefox.sh", - "./provision/core/toolcache.sh" + "./provision/core/toolcache.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -192,13 +193,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", From 1ddf2470ababf200d29e6abbd0600899215e982d Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 12:44:54 +0300 Subject: [PATCH 21/39] fixed function --- images/macos/provision/utils/utils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 1bca5c8a..7f295897 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -98,13 +98,14 @@ verlte() { [ "$1" = "$sortedVersion" ] } -brew_install_ignoring_sha256() { +brew_cask_install_ignoring_sha256() { local TOOL_NAME=$1 - CASK_DIR=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks + CASK_DIR="$(brew --repo homebrew/cask)/Casks" chmod a+w "$CASK_DIR/$TOOL_NAME.rb" SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" brew cask install $TOOL_NAME - sed -i '' "s/:no_check/:$SHA/" "$CASK_DIR/$TOOL_NAME.rb" + cd $CASK_DIR + git reset --hard } \ No newline at end of file From 00bb4818cec8f8676369d59f0eb33f7802ca37f2 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 15:50:53 +0300 Subject: [PATCH 22/39] fixed pipx packages tests --- images/macos/tests/Linters.Tests.ps1 | 4 ---- images/macos/tests/PipxPackages.Tests.ps1 | 7 +++++++ images/macos/toolsets/toolset-10.13.json | 2 +- images/macos/toolsets/toolset-10.14.json | 2 +- images/macos/toolsets/toolset-10.15.json | 2 +- images/macos/toolsets/toolset-11.0.json | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 images/macos/tests/PipxPackages.Tests.ps1 diff --git a/images/macos/tests/Linters.Tests.ps1 b/images/macos/tests/Linters.Tests.ps1 index 3b7b8e0d..31d3698c 100644 --- a/images/macos/tests/Linters.Tests.ps1 +++ b/images/macos/tests/Linters.Tests.ps1 @@ -3,10 +3,6 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" $os = Get-OSVersion Describe "Linters" { - It "yamllint" { - "yamllint --version" | Should -ReturnZeroExitCode - } - It "SwiftLint" -Skip:($os.IsHighSierra) { "swiftlint version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/PipxPackages.Tests.ps1 b/images/macos/tests/PipxPackages.Tests.ps1 new file mode 100644 index 00000000..ed981938 --- /dev/null +++ b/images/macos/tests/PipxPackages.Tests.ps1 @@ -0,0 +1,7 @@ +Describe "PipxPackages" { + $pipxToolset = Get-ToolsetValue "pipx" + $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } + It "" -TestCases $testCases { + "$cmd" | Should -ReturnZeroExitCode + } +} \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.13.json b/images/macos/toolsets/toolset-10.13.json index f1ce3b06..3bf62968 100644 --- a/images/macos/toolsets/toolset-10.13.json +++ b/images/macos/toolsets/toolset-10.13.json @@ -198,7 +198,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.14.json b/images/macos/toolsets/toolset-10.14.json index f1c70a83..aa1b4101 100644 --- a/images/macos/toolsets/toolset-10.14.json +++ b/images/macos/toolsets/toolset-10.14.json @@ -258,7 +258,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index e2debc9f..c54db919 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -167,7 +167,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index e5cf3e64..ed8903d3 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -92,7 +92,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file From 38bc88214f8e65cc04dff4f728f363defa6d8c78 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 16:36:03 +0300 Subject: [PATCH 23/39] fixed brew_cask_install_ignoring_sha256 function --- images/macos/provision/utils/utils.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 7f295897..97e9b18c 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -106,6 +106,7 @@ brew_cask_install_ignoring_sha256() { SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" brew cask install $TOOL_NAME - cd $CASK_DIR - git reset --hard + pushd $CASK_DIR + git checkout HEAD -- "$TOOL_NAME.rb" + popd } \ No newline at end of file From 62eca78ba7e61a60a7c9e2952f674ebb2b06b06e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Thu, 22 Oct 2020 09:48:03 +0300 Subject: [PATCH 24/39] fixed naming --- images/macos/provision/core/chrome.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/core/chrome.sh b/images/macos/provision/core/chrome.sh index aad4fb4d..5f8b4bdd 100644 --- a/images/macos/provision/core/chrome.sh +++ b/images/macos/provision/core/chrome.sh @@ -1,7 +1,7 @@ source ~/utils/utils.sh echo "Installing Chrome..." -brew_install_ignoring_sha256 "google-chrome" +brew_cask_install_ignoring_sha256 "google-chrome" echo "Installing Chrome Driver" brew cask install chromedriver From fc389f0cc0a1420c2249ceeb830609a682b6166f Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 23 Oct 2020 14:30:10 +0300 Subject: [PATCH 25/39] fix ssh-keyscan Windows Server 2016 --- images/win/scripts/Install-OpenSSH.ps1 | 13 +++++++++++++ images/win/windows2016.json | 1 + 2 files changed, 14 insertions(+) create mode 100644 images/win/scripts/Install-OpenSSH.ps1 diff --git a/images/win/scripts/Install-OpenSSH.ps1 b/images/win/scripts/Install-OpenSSH.ps1 new file mode 100644 index 00000000..b0ea1527 --- /dev/null +++ b/images/win/scripts/Install-OpenSSH.ps1 @@ -0,0 +1,13 @@ +################################################################################ +## File: Install-OpenSSH.ps1 +## Desc: Install OpenSSH-Win64 +################################################################################ + +Write-Host "Download Latest OpenSSH-Win64 archive" +$url = 'https://api.github.com/repos/PowerShell/Win32-OpenSSH/releases/latest' +$name = 'OpenSSH-Win64.zip' +# Explicitly set type to string since match returns array by default +[string]$opensshLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match $name +$opensshArchivePath = Start-DownloadWithRetry -Url $opensshLatest -Name $name +Write-Host "Expand OpenSSH-Win64 archive" +Extract-7Zip -Path $opensshArchivePath -DestinationPath $env:ProgramFiles \ No newline at end of file diff --git a/images/win/windows2016.json b/images/win/windows2016.json index a008e760..43faaa25 100644 --- a/images/win/windows2016.json +++ b/images/win/windows2016.json @@ -245,6 +245,7 @@ "{{ template_dir }}/scripts/Installers/Install-Sbt.ps1", "{{ template_dir }}/scripts/Installers/Install-OpenSSL.ps1", "{{ template_dir }}/scripts/Installers/Install-Perl.ps1", + "{{ template_dir }}/scripts/Installers/Install-OpenSSH.ps1", "{{ template_dir }}/scripts/Installers/Install-Git.ps1", "{{ template_dir }}/scripts/Installers/Install-GitHub-CLI.ps1", "{{ template_dir }}/scripts/Installers/Install-PHP.ps1", From e8bd1e858e9ce94c75a0450995034d8941c2d247 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 23 Oct 2020 14:37:52 +0300 Subject: [PATCH 26/39] move Install-OpenSSH.ps1 --- images/win/scripts/{ => Installers}/Install-OpenSSH.ps1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename images/win/scripts/{ => Installers}/Install-OpenSSH.ps1 (100%) diff --git a/images/win/scripts/Install-OpenSSH.ps1 b/images/win/scripts/Installers/Install-OpenSSH.ps1 similarity index 100% rename from images/win/scripts/Install-OpenSSH.ps1 rename to images/win/scripts/Installers/Install-OpenSSH.ps1 From 96faa1ea2a69b8bdcef676f8fae168439085e0ee Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 26 Oct 2020 12:20:14 +0300 Subject: [PATCH 27/39] fix mingw64 --- images/win/scripts/Installers/Install-Mingw64.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Install-Mingw64.ps1 b/images/win/scripts/Installers/Install-Mingw64.ps1 index b6c86048..2b999f45 100644 --- a/images/win/scripts/Installers/Install-Mingw64.ps1 +++ b/images/win/scripts/Installers/Install-Mingw64.ps1 @@ -7,7 +7,7 @@ Choco-Install -PackageName mingw # Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name # and so the same command line can be used on Windows as on macOS and Linux -$path = where.exe mingw32-make.exe | Get-Item +$path = Get-Command mingw32-make.exe -CommandType All | Where-Object { $_.Path.Contains("C:\ProgramData\Chocolatey") } | Get-Item Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe') Invoke-PesterTests -TestFile "Tools" -TestName "Mingw64" From eb92aba93bcc53d0028086ea6abd8f2e53d12994 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 26 Oct 2020 14:33:46 +0300 Subject: [PATCH 28/39] add ssh host keys --- images/win/scripts/Installers/Install-Msys2.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index b077f5cd..844c071b 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -57,6 +57,10 @@ Write-Host "`n$dash Install mingw32 packages" $pre = "mingw-w64-i686-" pacman.exe -S --noconfirm --needed --noprogressbar $tools32.replace('___', $pre).split(' ') +# install openssh +Write-Host "`n$dash Install openssh package" +pacman.exe -S --noconfirm --needed --noprogressbar openssh + # clean all packages to decrease image size Write-Host "`n$dash Clean packages" pacman.exe -Scc --noconfirm @@ -80,4 +84,8 @@ $pathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' $pathValue += ";C:\msys64\mingw64\bin;C:\msys64\usr\bin" Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $pathValue +# Add well-known SSH host keys to ssh_known_hosts +ssh-keyscan -t rsa github.com >> "C:\msys64\etc\ssh\ssh_known_hosts" +ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\msys64\etc\ssh\ssh_known_hosts" + Invoke-PesterTests -TestFile "MSYS2" From 222f3bb86f3d9f64c0832a70469fa45f717c7567 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 27 Oct 2020 11:05:36 +0300 Subject: [PATCH 29/39] use ssh-keyscan from git --- images/win/scripts/Installers/Install-Git.ps1 | 2 +- images/win/scripts/Installers/Install-OpenSSH.ps1 | 13 ------------- images/win/windows2016.json | 2 -- images/win/windows2019.json | 1 - 4 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 images/win/scripts/Installers/Install-OpenSSH.ps1 diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index 2a5eb546..c7b2c457 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -37,7 +37,7 @@ Choco-Install -PackageName hub [Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine) if (Test-IsWin16) { - $env:Path += ";$env:ProgramFiles\OpenSSH-Win64" + $env:Path += ";$env:ProgramFiles\Git\usr\bin\" } # Add well-known SSH host keys to ssh_known_hosts diff --git a/images/win/scripts/Installers/Install-OpenSSH.ps1 b/images/win/scripts/Installers/Install-OpenSSH.ps1 deleted file mode 100644 index b0ea1527..00000000 --- a/images/win/scripts/Installers/Install-OpenSSH.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -## File: Install-OpenSSH.ps1 -## Desc: Install OpenSSH-Win64 -################################################################################ - -Write-Host "Download Latest OpenSSH-Win64 archive" -$url = 'https://api.github.com/repos/PowerShell/Win32-OpenSSH/releases/latest' -$name = 'OpenSSH-Win64.zip' -# Explicitly set type to string since match returns array by default -[string]$opensshLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match $name -$opensshArchivePath = Start-DownloadWithRetry -Url $opensshLatest -Name $name -Write-Host "Expand OpenSSH-Win64 archive" -Extract-7Zip -Path $opensshArchivePath -DestinationPath $env:ProgramFiles \ No newline at end of file diff --git a/images/win/windows2016.json b/images/win/windows2016.json index 43faaa25..8c1314d6 100644 --- a/images/win/windows2016.json +++ b/images/win/windows2016.json @@ -245,7 +245,6 @@ "{{ template_dir }}/scripts/Installers/Install-Sbt.ps1", "{{ template_dir }}/scripts/Installers/Install-OpenSSL.ps1", "{{ template_dir }}/scripts/Installers/Install-Perl.ps1", - "{{ template_dir }}/scripts/Installers/Install-OpenSSH.ps1", "{{ template_dir }}/scripts/Installers/Install-Git.ps1", "{{ template_dir }}/scripts/Installers/Install-GitHub-CLI.ps1", "{{ template_dir }}/scripts/Installers/Install-PHP.ps1", @@ -334,7 +333,6 @@ "scripts": [ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1", - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", "{{ template_dir }}/scripts/Installers/Configure-Shell.ps1" ], "elevated_user": "{{user `install_user`}}", diff --git a/images/win/windows2019.json b/images/win/windows2019.json index dd717711..a002f77f 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -331,7 +331,6 @@ "scripts": [ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1", - "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1", "{{ template_dir }}/scripts/Installers/Configure-Shell.ps1" ], "elevated_user": "{{user `install_user`}}", From dd325a465c472ed319823fd4adbcca97d9039a11 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:14:56 +0300 Subject: [PATCH 30/39] clean yarn and npm cache --- images/win/scripts/Installers/Finalize-VM.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/images/win/scripts/Installers/Finalize-VM.ps1 b/images/win/scripts/Installers/Finalize-VM.ps1 index 4e7a260c..d0bb3d26 100644 --- a/images/win/scripts/Installers/Finalize-VM.ps1 +++ b/images/win/scripts/Installers/Finalize-VM.ps1 @@ -30,3 +30,7 @@ New-Item -Path $winInstallDir -ItemType Directory -Force # Remove AllUsersAllHosts profile Remove-Item $profile.AllUsersAllHosts -Force + +# Clean yarn and npm cache +yarn cache clean +npm cache clean --force \ No newline at end of file From 75112c44494939066cc3b793aa3bb99f2cde4335 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:24:59 +0300 Subject: [PATCH 31/39] clean yarn and npm cache --- images/linux/scripts/installers/post-deployment.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/images/linux/scripts/installers/post-deployment.sh b/images/linux/scripts/installers/post-deployment.sh index 95a2e2fa..d427a172 100644 --- a/images/linux/scripts/installers/post-deployment.sh +++ b/images/linux/scripts/installers/post-deployment.sh @@ -24,3 +24,7 @@ then echo "PATH = $PATH" exit 1 fi + +# Clean yarn and npm cache +yarn cache clean +npm cache clean --force \ No newline at end of file From 6a7cc6229f259b3eed5c6d7ba0572bec4d2ba71f Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:54:16 +0300 Subject: [PATCH 32/39] clean yarn cache --- images/macos/provision/configuration/finalize-vm.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index b6975139..c08da558 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -20,5 +20,8 @@ cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-gene # we have to do that here because `npm install` is run in a few different places during image-generation npm cache clean --force +# Clean yarn cache +yarn cache clean + # Clean up temporary directories -rm -rf ~/utils ~/image-generation \ No newline at end of file +rm -rf ~/utils ~/image-generation From 4e5143b7328a848bc29826d611666d6253741062 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:56:52 +0300 Subject: [PATCH 33/39] delete extra line --- images/macos/provision/configuration/finalize-vm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index c08da558..b7cef4db 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -24,4 +24,4 @@ npm cache clean --force yarn cache clean # Clean up temporary directories -rm -rf ~/utils ~/image-generation +rm -rf ~/utils ~/image-generation \ No newline at end of file From d4973999576f7423cfdf80bdfe77a44c1ab3dc8e Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 27 Oct 2020 18:36:59 +0300 Subject: [PATCH 34/39] resolve comments --- images/macos/provision/configuration/finalize-vm.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index 256a76c5..2b1967bc 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -17,9 +17,7 @@ fi cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/ # Put build vm assets scripts to proper directory -sudo mkdir -p /usr/local/opt/$USER/scripts -sudo chmod ugo+rwx /usr/local/opt/$USER/scripts -sudo chown $USER:admin /usr/local/opt/$USER +mkdir -p /usr/local/opt/$USER/scripts mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \; From 37d1fd3e1af0c8a9500f5fc31f7864e4657f34ab Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 28 Oct 2020 09:29:33 +0300 Subject: [PATCH 35/39] update base url --- images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 b/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 index 60cbbefa..37f5ece9 100644 --- a/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 +++ b/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 @@ -3,7 +3,7 @@ ## Desc: Install SQL PowerShell tool ################################################################################ -$BaseUrl = "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64" +$BaseUrl = "https://download.microsoft.com/download/B/1/7/B1783FE9-717B-4F78-A39A-A2E27E3D679D/ENU/x64" # install required MSIs $SQLSysClrTypesName = "SQLSysClrTypes.msi" From 303f963f21b297f9fe8f0d07f0ceca7adf1cad55 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 28 Oct 2020 09:33:55 +0300 Subject: [PATCH 36/39] update base url --- images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 b/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 index 60cbbefa..37f5ece9 100644 --- a/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 +++ b/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1 @@ -3,7 +3,7 @@ ## Desc: Install SQL PowerShell tool ################################################################################ -$BaseUrl = "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64" +$BaseUrl = "https://download.microsoft.com/download/B/1/7/B1783FE9-717B-4F78-A39A-A2E27E3D679D/ENU/x64" # install required MSIs $SQLSysClrTypesName = "SQLSysClrTypes.msi" From 3ef46361f35afc327cfad7d86bed53ef2eb4c00d Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 28 Oct 2020 09:41:57 +0300 Subject: [PATCH 37/39] update ssh-keyscan in msys2 script --- images/win/scripts/Installers/Install-Git.ps1 | 8 -------- images/win/scripts/Installers/Install-Msys2.ps1 | 9 ++++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index c7b2c457..6c89250e 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -36,13 +36,5 @@ Choco-Install -PackageName hub # Disable GCM machine-wide [Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine) -if (Test-IsWin16) { - $env:Path += ";$env:ProgramFiles\Git\usr\bin\" -} - -# Add well-known SSH host keys to ssh_known_hosts -ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" -ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" - Invoke-PesterTests -TestFile "Git" -TestName "Git" Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI" diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index 844c071b..dea3b95d 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -84,8 +84,15 @@ $pathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' $pathValue += ";C:\msys64\mingw64\bin;C:\msys64\usr\bin" Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $pathValue -# Add well-known SSH host keys to ssh_known_hosts +# Add well-known SSH host keys to ssh_known_hosts to Msys2 ssh-keyscan -t rsa github.com >> "C:\msys64\etc\ssh\ssh_known_hosts" ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\msys64\etc\ssh\ssh_known_hosts" +# Add well-known SSH host keys to ssh_known_hosts to Git +if (Test-Path "C:\Program Files\Git\etc\ssh") +{ + ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" + ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" +} + Invoke-PesterTests -TestFile "MSYS2" From 3c77354cd5064d1ad8c3cb4b41648cf6bbb5648e Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Wed, 28 Oct 2020 17:58:15 +0300 Subject: [PATCH 38/39] [ubuntu] fix user on rust and brew scripts (#1907) * fix user on rust and brew scripts * set user on a factory stage * get last user from /etc/passwd Co-authored-by: Leonid Lapshin --- images/linux/post-generation/homebrew-permissions.sh | 7 +++++-- images/linux/post-generation/rust-permissions.sh | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/images/linux/post-generation/homebrew-permissions.sh b/images/linux/post-generation/homebrew-permissions.sh index 1dbd043e..edd15fb7 100644 --- a/images/linux/post-generation/homebrew-permissions.sh +++ b/images/linux/post-generation/homebrew-permissions.sh @@ -2,10 +2,13 @@ # Fix permissions for Homebrew # https://github.com/actions/virtual-environments/issues/1568 + brew_folder="/home/linuxbrew/" +homebrew_user=$(cut -d: -f1 /etc/passwd | tail -1) + if [ -d "$brew_folder" ]; then brew_folder_owner=$(ls -ld $brew_folder | awk '{print $3}') - if [ "$USER" != "$brew_folder_owner" ]; then - chown "$USER":docker -R $brew_folder + if [ "$homebrew_user" != "$brew_folder_owner" ]; then + chown "$homebrew_user":docker -R $brew_folder fi fi diff --git a/images/linux/post-generation/rust-permissions.sh b/images/linux/post-generation/rust-permissions.sh index 6673686b..aff56ca1 100644 --- a/images/linux/post-generation/rust-permissions.sh +++ b/images/linux/post-generation/rust-permissions.sh @@ -2,10 +2,13 @@ # Fix permissions for the Rust folder # https://github.com/actions/virtual-environments/issues/572 + rust_folder="/usr/share/rust" +rust_user=$(cut -d: -f1 /etc/passwd | tail -1) + if [ -d "$rust_folder" ]; then rust_folder_owner=$(ls -ld $rust_folder | awk '{print $3}') - if [ "$USER" != "$rust_folder_owner" ]; then - chown "$USER":docker -R $rust_folder + if [ "$rust_user" != "$rust_folder_owner" ]; then + chown "$rust_user":docker -R $rust_folder fi fi From 2ebe53b86dfe4ee7558bb9de969f0a4b8fb8a856 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 19:01:39 +0000 Subject: [PATCH 39/39] Updating readme file for win16 version 20201020.1 (#1870) Co-authored-by: Image generation service account Co-authored-by: Actions service account --- images/win/Windows2016-Readme.md | 73 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/images/win/Windows2016-Readme.md b/images/win/Windows2016-Readme.md index f184b50a..05e7c2d6 100644 --- a/images/win/Windows2016-Readme.md +++ b/images/win/Windows2016-Readme.md @@ -1,10 +1,11 @@ | Announcements | |-| +| [[Ubuntu] [Windows] Boost 1.69.0 will be deprecated on November, 10](https://github.com/actions/virtual-environments/issues/1847) | | [[In Discussion] Git internal tools will be removed from PATH Windows images and replaced with MSYS2 tools](https://github.com/actions/virtual-environments/issues/1525) | *** # Microsoft Windows Server 2016 Datacenter -- OS Version: 10.0.14393 Build 3930 -- Image Version: 20201012.1 +- OS Version: 10.0.14393 Build 3986 +- Image Version: 20201020.1 ## Installed Software ### Language and Runtime @@ -14,7 +15,7 @@ - Java 13.0.2 - Python 3.7.9 - Ruby 2.5.8p224 -- Go 1.14.9 +- Go 1.14.10 - PHP 7.4.11 - Julia 1.5.2 - Perl 5.32.0 @@ -25,46 +26,46 @@ - Vcpkg 2020.06.15 - NPM 6.14.8 - Yarn 1.22.10 -- pip 20.2.3 (python 3.7) -- Miniconda 4.6.14 +- pip 20.2.4 (python 3.7) +- Miniconda 4.8.3 - RubyGems 3.1.4 - Helm 3.3.4 -- Composer 1.10.13 +- Composer 1.10.15 - NuGet 5.7.0.6726 ### Project Management - Ant 1.10.9 - Maven 3.6.3 -- Gradle 6.6 +- Gradle 6.7 - sbt 1.4.0 ### Tools - azcopy 10.6.0 -- Bazel 3.6.0 -- Bazelisk 1.7.1 +- Bazel 3.7.0 +- Bazelisk 1.7.3 - CMake 3.18.4 -- CodeQL Action Bundle 2.2.5 +- CodeQL Action Bundle 2.3.0 - R 4.0.3 - Docker 19.03.12 -- Docker-compose 1.27.2 -- Git 2.28.0 -- Git LFS 2.11.0 -- Google Cloud SDK 313.0.1 +- Docker-compose 1.27.4 +- Git 2.29.0 +- Git LFS 2.12.0 +- Google Cloud SDK 315.0.0 - InnoSetup 6.0.5 - jq 1.6 -- Kubectl 1.19.1 +- Kubectl 1.19.3 - Kind 0.9.0 - Mingw-w64 8.1.0 - Mercurial 5.0 - NSIS v3.06.1 - Newman 5.2.0 - OpenSSL 1.1.1 -- Packer 1.6.3 -- Pulumi v2.11.2 +- Packer 1.6.4 +- Pulumi v2.12.0 - Subversion (SVN) 1.14.0 - ghc 8.10.2 - Cabal 3.2.0.0 -- Stack 2.3.3 +- Stack 2.5.1 - WinAppDriver 1.1.1809.18001 - zstd 1.4.5 - VSWhere 2.8.4 @@ -72,12 +73,12 @@ - yamllint 1.25.0 ### CLI Tools -- Azure CLI 2.12.1 +- Azure CLI 2.13.0 - Azure DevOps CLI extension 0.18.0 - Azure Dev Spaces CLI 1.0.20200921.3 -- AWS CLI 2.0.56 +- AWS CLI 2.0.57 - AWS SAM CLI 1.6.2 -- AWS Session Manager CLI 1.1.61.0 +- AWS Session Manager CLI 1.2.7.0 - Alibaba Cloud CLI 3.0.60 - Cloud Foundry CLI 6.53.0 - Hub CLI 2.14.2 @@ -93,11 +94,11 @@ - cargo-outdated v0.9.11 ### Browsers and webdrivers -- Google Chrome 86.0.4240.75 +- Google Chrome 86.0.4240.111 - Chrome Driver 86.0.4240.22 -- Microsoft Edge 86.0.622.38 -- Microsoft Edge Driver 86.0.622.38 -- Mozilla Firefox 81.0.1 +- Microsoft Edge 86.0.622.48 +- Microsoft Edge Driver 86.0.622.48 +- Mozilla Firefox 82.0 - Gecko Driver 0.27.0 - IE Driver 3.150.1.0 @@ -137,8 +138,8 @@ Note: MSYS2 is pre-installed on image but not added to PATH. | 1.11.13 | x64 | GOROOT_1_11_X64 | | 1.12.17 | x64 | GOROOT_1_12_X64 | | 1.13.15 | x64 | GOROOT_1_13_X64 | -| 1.14.9 (Default) | x64 | GOROOT_1_14_X64 | -| 1.15.2 | x64 | GOROOT_1_15_X64 | +| 1.14.10 (Default) | x64 | GOROOT_1_14_X64 | +| 1.15.3 | x64 | GOROOT_1_15_X64 | #### Node @@ -147,7 +148,7 @@ Note: MSYS2 is pre-installed on image but not added to PATH. | 8.17.0 | x64 | | 10.22.1 | x64 | | 12.19.0 | x64 | -| 14.13.1 | x64 | +| 14.14.0 | x64 | #### Python @@ -158,6 +159,7 @@ Note: MSYS2 is pre-installed on image but not added to PATH. | 3.6.8 | x64, x86 | | 3.7.9 (Default) | x64, x86 | | 3.8.6 | x64, x86 | +| 3.9.0 | x64, x86 | #### Ruby @@ -200,6 +202,7 @@ Note: MSYS2 is pre-installed on image but not added to PATH. ### Database tools - Azure CosmosDb Emulator 2.11.6.0 +- DacFx 15.0.4897.1 - SQLPS 1.0 - MySQL 5.7.21.0 @@ -207,7 +210,7 @@ Note: MSYS2 is pre-installed on image but not added to PATH. ### Visual Studio Enterprise 2017 | Name | Version | Path | | ----------------------------- | --------------- | -------------------------------------------------------------- | -| Visual Studio Enterprise 2017 | 15.9.28307.1259 | C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise | +| Visual Studio Enterprise 2017 | 15.9.28307.1274 | C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise | #### Workloads, components and extensions: @@ -476,20 +479,20 @@ Note: MSYS2 is pre-installed on image but not added to PATH. ### .NET Core SDK `Location C:\Program Files\dotnet\sdk` -- 1.1.14 2.1.300 2.1.301 2.1.302 2.1.401 2.1.402 2.1.403 2.1.500 2.1.502 2.1.503 2.1.504 2.1.505 2.1.506 2.1.507 2.1.508 2.1.509 2.1.510 2.1.511 2.1.512 2.1.513 2.1.514 2.1.515 2.1.516 2.1.517 2.1.518 2.1.602 2.1.603 2.1.604 2.1.605 2.1.606 2.1.607 2.1.608 2.1.609 2.1.610 2.1.611 2.1.612 2.1.613 2.1.614 2.1.615 2.1.700 2.1.701 2.1.801 2.1.802 2.1.803 2.1.804 2.1.805 2.1.806 2.1.807 2.1.808 2.1.809 2.1.810 3.1.100 3.1.101 3.1.102 3.1.103 3.1.104 3.1.105 3.1.106 3.1.107 3.1.108 3.1.200 3.1.201 3.1.202 3.1.300 3.1.301 3.1.302 3.1.401 3.1.402 +- 1.1.14 2.1.300 2.1.301 2.1.302 2.1.401 2.1.402 2.1.403 2.1.500 2.1.502 2.1.503 2.1.504 2.1.505 2.1.506 2.1.507 2.1.508 2.1.509 2.1.510 2.1.511 2.1.512 2.1.513 2.1.514 2.1.515 2.1.516 2.1.517 2.1.518 2.1.519 2.1.602 2.1.603 2.1.604 2.1.605 2.1.606 2.1.607 2.1.608 2.1.609 2.1.610 2.1.611 2.1.612 2.1.613 2.1.614 2.1.615 2.1.616 2.1.700 2.1.701 2.1.801 2.1.802 2.1.803 2.1.804 2.1.805 2.1.806 2.1.807 2.1.808 2.1.809 2.1.810 2.1.811 3.1.100 3.1.101 3.1.102 3.1.103 3.1.104 3.1.105 3.1.106 3.1.107 3.1.108 3.1.109 3.1.200 3.1.201 3.1.202 3.1.300 3.1.301 3.1.302 3.1.401 3.1.402 3.1.403 ### .NET Core Runtime `Location: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All` -- 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 +- 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 2.1.23 `Location: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App` -- 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 +- 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 2.1.23 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 `Location: C:\Program Files\dotnet\shared\Microsoft.NETCore.App` -- 1.0.16 1.1.13 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 +- 1.0.16 1.1.13 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.20 2.1.21 2.1.22 2.1.23 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 `Location: C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App` -- 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 +- 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 ### .NET Framework `Type: Developer Pack` @@ -518,7 +521,7 @@ All other versions are saved but not installed. | Pester | 3.4.0
5.0.4 | | PowerShellGet | 1.0.0.1
2.2.4.1
2.2.5 | | PSWindowsUpdate | 2.2.0.2 | -| SqlServer | 21.1.18228 | +| SqlServer | 21.1.18229 | | VSSetup | 2.2.16 | ### Android