diff --git a/images.CI/macos/azure-pipelines/image-generation.yml b/images.CI/macos/azure-pipelines/image-generation.yml index f38d2fdc..89216e21 100644 --- a/images.CI/macos/azure-pipelines/image-generation.yml +++ b/images.CI/macos/azure-pipelines/image-generation.yml @@ -7,12 +7,13 @@ jobs: variables: - group: Mac-Cloud Image Generation - group: Mac-Cloud Image Generation Key Vault - - name: VirtualMachineName - value: $(Build.BuildNumber).$(System.JobAttempt) steps: - - bash: | - echo "##vso[build.updatebuildnumber]${{ variables.VirtualMachineName }}" + - pwsh: | + $cleanBuildNumber = "$(Build.BuildNumber)" -replace "(.+_unstable)(\.\d+)", '$1' + $virtualMachineName = "${cleanBuildNumber}.$(System.JobAttempt)" + echo "##vso[task.setvariable variable=VirtualMachineName;]$virtualMachineName" + echo "##vso[build.updatebuildnumber]$virtualMachineName" displayName: Update BuildNumber - checkout: self @@ -71,7 +72,7 @@ jobs: -var="output_folder=$(output-folder)" ` -var="vm_username=$(vm-username)" ` -var="vm_password=$(vm-password)" ` - -var="build_id=${{ variables.VirtualMachineName }}" ` + -var="build_id=$(VirtualMachineName)" ` -var="baseimage_name=${{ parameters.base_image_name }}" ` -var="github_feed_token=$(github-feed-token)" ` -var="xcode_install_user=$(xcode-installation-user)" ` @@ -98,7 +99,7 @@ jobs: ls $(Common.TestResultsDirectory) echo "Put VM name to 'VM_Done_Name' file" - echo "${{ variables.VirtualMachineName }}" > "$(Build.ArtifactStagingDirectory)/VM_Done_Name" + echo "$(VirtualMachineName)" > "$(Build.ArtifactStagingDirectory)/VM_Done_Name" displayName: Prepare artifact - bash: | @@ -125,7 +126,7 @@ jobs: inputs: targetType: 'filePath' filePath: ./images.CI/macos/move-vm.ps1 - arguments: -VMName "${{ variables.VirtualMachineName }}" ` + arguments: -VMName "$(VirtualMachineName)" ` -TargetDataStore "${{ parameters.target_datastore }}" ` -VIServer "$(vcenter-server-v2)" ` -VIUserName "$(vcenter-username-v2)" ` @@ -137,7 +138,7 @@ jobs: inputs: targetType: 'filePath' filePath: ./images.CI/macos/destroy-vm.ps1 - arguments: -VMName "${{ variables.VirtualMachineName }}" ` + arguments: -VMName "$(VirtualMachineName)" ` -VIServer "$(vcenter-server-v2)" ` -VIUserName "$(vcenter-username-v2)" ` -VIPassword "$(vcenter-password-v2)" diff --git a/images/macos/helpers/Common.Helpers.psm1 b/images/macos/helpers/Common.Helpers.psm1 index aa2ffdc5..dd8a2184 100644 --- a/images/macos/helpers/Common.Helpers.psm1 +++ b/images/macos/helpers/Common.Helpers.psm1 @@ -24,7 +24,7 @@ function Get-EnvironmentVariable($variable) { } # Returns the object with information about current OS -# It can be used for OS-specific tests +# It can be used for OS-specific tests function Get-OSVersion { $osVersion = [Environment]::OSVersion return [PSCustomObject]@{ @@ -36,7 +36,7 @@ function Get-OSVersion { IsBigSur = $osVersion.Version.Major -eq 20 IsLessThanCatalina = $osVersion.Version.Major -lt 19 IsLessThanBigSur = $osVersion.Version.Major -lt 20 - IsHigherThanMojave = $osVersion.Version.Major -gt 18 + IsHigherThanMojave = $osVersion.Version.Major -gt 18 } } @@ -63,7 +63,7 @@ function Get-ToolsetValue { $jsonNode = Get-Content -Raw $toolsetPath | ConvertFrom-Json $pathParts = $KeyPath.Split(".") - # try to walk through all arguments consequentially to resolve specific json node + # try to walk through all arguments consequentially to resolve specific json node $pathParts | ForEach-Object { $jsonNode = $jsonNode.$_ } @@ -73,4 +73,13 @@ function Get-ToolsetValue { function Get-ToolcachePackages { $toolcachePath = Join-Path $env:HOME "image-generation" "toolcache.json" return Get-Content -Raw $toolcachePath | ConvertFrom-Json -} \ No newline at end of file +} + +function Invoke-RestMethodWithRetry { + param ( + [Parameter()] + [string] + $Url + ) + Invoke-RestMethod $Url -MaximumRetryCount 10 -RetryIntervalSec 30 +} diff --git a/images/macos/provision/core/toolset.ps1 b/images/macos/provision/core/toolset.ps1 index bc016c4b..9238b9ff 100644 --- a/images/macos/provision/core/toolset.ps1 +++ b/images/macos/provision/core/toolset.ps1 @@ -4,6 +4,8 @@ ## Desc: Install toolset ################################################################################ +Import-Module "~/image-generation/helpers/Common.Helpers.psm1" + Function Get-ToolcacheFromToolset { $toolsetPath = Join-Path $env:HOME "image-generation" "toolset.json" $toolsetJson = Get-Content -Raw $toolsetPath | ConvertFrom-Json @@ -38,7 +40,7 @@ $tools = Get-ToolcacheFromToolset | Where-Object {$ToolsToInstall -contains $_. foreach ($tool in $tools) { # Get versions manifest for current tool - $assets = Invoke-RestMethod $tool.url + $assets = Invoke-RestMethodWithRetry -Url $tool.url # Get github release asset for each version foreach ($version in $tool.versions) { diff --git a/images/win/Windows2019-Readme.md b/images/win/Windows2019-Readme.md index 1c8c72c6..a153b8d4 100644 --- a/images/win/Windows2019-Readme.md +++ b/images/win/Windows2019-Readme.md @@ -1,10 +1,10 @@ | Announcements | |-| -| [[In Discussion] Git internal tools will be removed from PATH Windows images](https://github.com/actions/virtual-environments/issues/1525) | +| [[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 2019 Datacenter - OS Version: 10.0.17763 Build 1457 -- Image Version: 20201004.1 +- Image Version: 20201011.1 ## Enabled windows optional features - Windows Subsystem for Linux @@ -21,12 +21,12 @@ - PHP 7.4.11 - Julia 1.5.2 - Perl 5.32.0 -- Node 12.18.4 +- Node 12.19.0 ### Package Management - Chocolatey 0.10.15 - Vcpkg 2020.06.15 -- NPM 6.14.6 +- NPM 6.14.8 - Yarn 1.22.10 - pip 20.2.3 (python 3.7) - Miniconda 4.6.14 @@ -39,35 +39,31 @@ - Ant 1.10.9 - Maven 3.6.3 - Gradle 6.6 -- sbt 1.3.13 +- sbt 1.4.0 ### Tools -- Azure CosmosDb Emulator 2.11.5.0 - azcopy 10.6.0 -- Bazel 3.5.1 -- Bazelisk 1.6.1 -- CMake 3.18.3 +- Bazel 3.6.0 +- Bazelisk 1.7.1 +- CMake 3.18.4 - CodeQL Action Bundle 2.2.5 -- R 4.0.2 +- 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 312.0.0 +- Google Cloud SDK 313.0.1 - InnoSetup 6.0.5 - jq 1.6 - Kubectl 1.19.1 - Kind 0.9.0 - Mingw-w64 8.1.0 -- MySQL 5.7.21.0 - Mercurial 5.0 - NSIS v3.06.1 - Newman 5.2.0 - OpenSSL 1.1.1 - Packer 1.6.3 - Pulumi v2.11.2 -- SQLPS 1.0 -- SQLServer PS 21.1.18228 - Subversion (SVN) 1.14.0 - ghc 8.10.2 - Cabal 3.2.0.0 @@ -82,28 +78,28 @@ - Azure CLI 2.12.1 - Azure DevOps CLI extension 0.18.0 - Azure Dev Spaces CLI 1.0.20200921.3 -- AWS CLI 2.0.54 -- AWS SAM CLI 1.4.0 +- AWS CLI 2.0.56 +- AWS SAM CLI 1.6.2 - AWS Session Manager CLI 1.1.61.0 -- Alibaba Cloud CLI 3.0.59 +- Alibaba Cloud CLI 3.0.60 - Cloud Foundry CLI 6.53.0 - Hub CLI 2.14.2 -- GitHub CLI 1.0.0 +- GitHub CLI 1.1.0 ### Rust Tools -- Rust 1.46.0 +- Rust 1.47.0 #### Packages - bindgen 0.55.1 -- cbindgen 0.14.6 +- cbindgen 0.15.0 - cargo-audit 0.12.1 - cargo-outdated v0.9.11 ### Browsers and webdrivers -- Google Chrome 85.0.4183.121 -- Chrome Driver 85.0.4183.87 -- Microsoft Edge 85.0.564.68 -- Microsoft Edge Driver 85.0.564.68 +- Google Chrome 86.0.4240.75 +- Chrome Driver 86.0.4240.22 +- Microsoft Edge 86.0.622.38 +- Microsoft Edge Driver 86.0.622.38 - Mozilla Firefox 81.0.1 - Gecko Driver 0.27.0 - IE Driver 3.150.1.0 @@ -153,8 +149,8 @@ Note: MSYS2 is pre-installed on image but not added to PATH. | ------- | ------------ | | 8.17.0 | x64 | | 10.22.1 | x64 | -| 12.18.4 | x64 | -| 14.13.0 | x64 | +| 12.19.0 | x64 | +| 14.13.1 | x64 | #### Python @@ -205,6 +201,12 @@ Note: MSYS2 is pre-installed on image but not added to PATH. +### Database tools +- Azure CosmosDb Emulator 2.11.6.0 +- SQLPS 1.0 +- MySQL 5.7.21.0 + + ### Visual Studio Enterprise 2019 | Name | Version | Path | | ----------------------------- | -------------- | -------------------------------------------------------------- | @@ -428,7 +430,7 @@ Note: MSYS2 is pre-installed on image but not added to PATH. | Microsoft.VisualStudio.Workload.Python | 16.0.28621.142 | | Microsoft.VisualStudio.Workload.Universal | 16.7.30310.162 | | Microsoft.VisualStudio.Workload.VisualStudioExtension | 16.4.29409.204 | -| SSDT Microsoft Analysis Services Projects | 2.9.13 | +| SSDT Microsoft Analysis Services Projects | 2.9.14 | | SSDT SQL Server Integration Services Projects | 3.10 | | SSDT Microsoft Reporting Services Projects | 2.6.7 | | Windows Driver Kit | 3.11.4516 | @@ -523,3 +525,5 @@ All other versions are saved but not installed. - mcr.microsoft.com/windows/servercore:ltsc2019 - mcr.microsoft.com/windows/nanoserver:1809 - microsoft/aspnetcore-build:1.0-2.0 + + diff --git a/images/win/scripts/ImageHelpers/VisualStudioHelpers.ps1 b/images/win/scripts/ImageHelpers/VisualStudioHelpers.ps1 index 0fd6bc8b..d5a5d59d 100644 --- a/images/win/scripts/ImageHelpers/VisualStudioHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/VisualStudioHelpers.ps1 @@ -49,6 +49,13 @@ Function Install-VisualStudio } else { + $setupErrorLogPath = "$env:TEMP\dd_setup_*_errors.log" + if (Test-Path -Path $setupErrorLogPath) + { + $logErrors = Get-Content -Path $setupErrorLogPath -Raw + Write-Host "$logErrors" + } + Write-Host "Non zero exit code returned by the installation process : $exitCode" exit $exitCode } diff --git a/images/win/scripts/Installers/Install-GitHub-CLI.ps1 b/images/win/scripts/Installers/Install-GitHub-CLI.ps1 index 7891991d..1efb2f74 100644 --- a/images/win/scripts/Installers/Install-GitHub-CLI.ps1 +++ b/images/win/scripts/Installers/Install-GitHub-CLI.ps1 @@ -3,8 +3,14 @@ ## Desc: Install GitHub CLI ################################################################################ -Choco-Install -PackageName gh +Write-Host "Get the latest gh version..." + +$Name = "gh_windows_amd64.msi" +$Assets = (Invoke-RestMethod -Uri "https://api.github.com/repos/cli/cli/releases/latest").assets +$DownloadUrl = ($Assets.browser_download_url -match "windows_amd64.msi") | Select-Object -First 1 + +Install-Binary -Url $DownloadUrl -Name $Name Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI" -Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI" \ No newline at end of file +Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI"