From 42827c5d7f0e54b0ec8a4627aa29cc15f9b2b8ff Mon Sep 17 00:00:00 2001 From: Hutson Betts Date: Mon, 21 Sep 2020 13:24:05 -0500 Subject: [PATCH 01/51] refactor: auto format JSON using VSC --- images/linux/ubuntu1604.json | 20 ++++---- images/linux/ubuntu1804.json | 20 ++++---- images/linux/ubuntu2004.json | 20 ++++---- images/win/Windows2016-Azure.json | 74 ++++++++++++++++-------------- images/win/Windows2019-Azure.json | 76 ++++++++++++++++--------------- 5 files changed, 112 insertions(+), 98 deletions(-) diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 33263345a..f354443dd 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -24,7 +24,10 @@ "run_validation_diskspace": "false", "announcements": "{{env `ANNOUNCEMENTS`}}" }, - "sensitive-variables": ["client_secret", "github_feed_token"], + "sensitive-variables": [ + "client_secret", + "github_feed_token" + ], "builders": [ { "type": "azure-arm", @@ -32,7 +35,6 @@ "client_secret": "{{user `client_secret`}}", "subscription_id": "{{user `subscription_id`}}", "tenant_id": "{{user `tenant_id`}}", - "location": "{{user `location`}}", "vm_size": "{{user `vm_size`}}", "resource_group_name": "{{user `resource_group`}}", @@ -62,7 +64,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/base/repos.sh" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" @@ -104,7 +106,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/preimagedata.sh" ], "environment_vars": [ @@ -217,7 +219,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-Toolset.ps1", "{{template_dir}}/scripts/installers/Configure-Toolset.ps1", "{{template_dir}}/scripts/installers/Validate-Toolset.ps1" @@ -269,14 +271,14 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/cleanup.sh" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1" ], "environment_vars": [ @@ -289,7 +291,7 @@ "inline": [ "pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], - "environment_vars":[ + "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" @@ -312,7 +314,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/validate-disk-space.sh" ], "environment_vars": [ diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 1dd62bc2d..c7f495a41 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -24,7 +24,10 @@ "run_validation_diskspace": "false", "announcements": "{{env `ANNOUNCEMENTS`}}" }, - "sensitive-variables": ["client_secret", "github_feed_token"], + "sensitive-variables": [ + "client_secret", + "github_feed_token" + ], "builders": [ { "type": "azure-arm", @@ -32,7 +35,6 @@ "client_secret": "{{user `client_secret`}}", "subscription_id": "{{user `subscription_id`}}", "tenant_id": "{{user `tenant_id`}}", - "location": "{{user `location`}}", "vm_size": "{{user `vm_size`}}", "resource_group_name": "{{user `resource_group`}}", @@ -62,7 +64,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/base/repos.sh" ], "environment_vars": [ @@ -107,7 +109,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/preimagedata.sh" ], "environment_vars": [ @@ -221,7 +223,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-Toolset.ps1", "{{template_dir}}/scripts/installers/Configure-Toolset.ps1", "{{template_dir}}/scripts/installers/Validate-Toolset.ps1" @@ -273,14 +275,14 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/cleanup.sh" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1" ], "environment_vars": [ @@ -293,7 +295,7 @@ "inline": [ "pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], - "environment_vars":[ + "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" @@ -316,7 +318,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/validate-disk-space.sh" ], "environment_vars": [ diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 67d6e1d6a..5bc469db2 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -26,7 +26,10 @@ "go_versions": "1.14", "announcements": "{{env `ANNOUNCEMENTS`}}" }, - "sensitive-variables": ["client_secret", "github_feed_token"], + "sensitive-variables": [ + "client_secret", + "github_feed_token" + ], "builders": [ { "type": "azure-arm", @@ -34,7 +37,6 @@ "client_secret": "{{user `client_secret`}}", "subscription_id": "{{user `subscription_id`}}", "tenant_id": "{{user `tenant_id`}}", - "location": "{{user `location`}}", "vm_size": "{{user `vm_size`}}", "resource_group_name": "{{user `resource_group`}}", @@ -64,7 +66,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/base/repos.sh" ], "environment_vars": [ @@ -109,7 +111,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/preimagedata.sh" ], "environment_vars": [ @@ -223,7 +225,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-Toolset.ps1", "{{template_dir}}/scripts/installers/Configure-Toolset.ps1", "{{template_dir}}/scripts/installers/Validate-Toolset.ps1" @@ -275,14 +277,14 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/cleanup.sh" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1" ], "environment_vars": [ @@ -295,7 +297,7 @@ "inline": [ "pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], - "environment_vars":[ + "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" @@ -309,7 +311,7 @@ }, { "type": "shell", - "scripts":[ + "scripts": [ "{{template_dir}}/scripts/installers/validate-disk-space.sh" ], "environment_vars": [ diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 6aa1423c6..1bb889993 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -15,7 +15,6 @@ "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", "vm_size": "Standard_DS4_v2", "run_scan_antivirus": "false", - "root_folder": "C:", "toolset_json_path": "{{env `TEMP`}}\\toolset.json", "image_folder": "C:\\image", @@ -30,7 +29,11 @@ "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", "announcements": "{{env `ANNOUNCEMENTS`}}" }, - "sensitive-variables": ["install_password", "client_secret", "github_feed_token"], + "sensitive-variables": [ + "install_password", + "client_secret", + "github_feed_token" + ], "builders": [ { "name": "vhd", @@ -65,7 +68,7 @@ "provisioners": [ { "type": "powershell", - "inline":[ + "inline": [ "New-Item -Path {{user `image_folder`}} -ItemType Directory -Force" ] }, @@ -97,7 +100,7 @@ { "type": "windows-shell", "inline": [ - "net user {{user `install_user`}} {{user `install_password`}} /add /passwordchg:no /passwordreq:yes /active:yes /Y" , + "net user {{user `install_user`}} {{user `install_password`}} /add /passwordchg:no /passwordreq:yes /active:yes /Y", "net localgroup Administrators {{user `install_user`}} /add", "winrm set winrm/config/service/auth @{Basic=\"true\"}", "winrm get winrm/config/service/auth" @@ -116,7 +119,7 @@ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1", "{{ template_dir }}/scripts/Installers/Initialize-VM.ps1", "{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1" @@ -125,7 +128,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-DotnetTLS.ps1", "{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1" ] @@ -137,8 +140,8 @@ { "type": "powershell", "inline": [ - "setx ImageVersion {{user `image_version` }} /m", - "setx ImageOS {{user `image_os` }} /m" + "setx ImageVersion {{user `image_version` }} /m", + "setx ImageOS {{user `image_os` }} /m" ] }, { @@ -147,7 +150,7 @@ "IMAGE_VERSION={{user `image_version`}}", "IMAGEDATA_FILE={{user `imagedata_file`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-ImageData.ps1", "{{ template_dir }}/scripts/Installers/Install-Docker.ps1", "{{ template_dir }}/scripts/Installers/Install-PowershellCore.ps1" @@ -159,7 +162,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1" ] }, @@ -169,10 +172,10 @@ 0, 3010 ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-VS.ps1", "{{ template_dir }}/scripts/Installers/Install-NET48.ps1", "{{ template_dir }}/scripts/Installers/Windows2016/Install-SSDT.ps1" @@ -182,10 +185,10 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1", "{{ template_dir }}/scripts/Installers/Install-Wix.ps1", "{{ template_dir }}/scripts/Installers/Install-WDK.ps1", @@ -194,7 +197,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" ], "execution_policy": "remotesigned" @@ -205,7 +208,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-AzureCli.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1", "{{ template_dir }}/scripts/Installers/Install-AzCopy.ps1", @@ -221,12 +224,12 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "GITHUB_FEED_TOKEN={{ user `github_feed_token` }}", "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "ROOT_FOLDER={{user `root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Download-ToolCache.ps1", "{{ template_dir }}/scripts/Installers/Install-PyPy.ps1", "{{ template_dir }}/scripts/Installers/Install-Toolset.ps1", @@ -237,7 +240,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Sbt.ps1", "{{ template_dir }}/scripts/Installers/Install-OpenSSL.ps1", "{{ template_dir }}/scripts/Installers/Install-Perl.ps1", @@ -256,7 +259,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Enable-DeveloperMode.ps1" ], "elevated_user": "{{user `install_user`}}", @@ -264,21 +267,23 @@ }, { "type": "windows-shell", - "inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"] + "inline": [ + "wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive" + ] }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-AzureModules.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-VSWhere.ps1", "{{ template_dir }}/scripts/Installers/Install-WinAppDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-Cmake.ps1", @@ -290,18 +295,17 @@ "{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1" ] }, - { "type": "powershell", "elevated_user": "SYSTEM", "elevated_password": "", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Mingw64.ps1", "{{ template_dir }}/scripts/Installers/Install-TypeScript.ps1", "{{ template_dir }}/scripts/Installers/Install-Haskell.ps1", @@ -324,7 +328,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1" ], @@ -337,10 +341,10 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1" ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}", "ROOT_FOLDER={{user `root_folder`}}" @@ -351,7 +355,7 @@ "inline": [ "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "ANNOUNCEMENTS={{user `announcements`}}" ] @@ -364,7 +368,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Finalize-VM.ps1" ] }, @@ -374,16 +378,16 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "RUN_SCAN_ANTIVIRUS={{user `run_scan_antivirus`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Run-Antivirus.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1", "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" ] diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 515caba9d..7f32c9980 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -15,7 +15,6 @@ "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", "vm_size": "Standard_D4_v2", "run_scan_antivirus": "false", - "root_folder": "C:", "toolset_json_path": "{{env `TEMP`}}\\toolset.json", "image_folder": "C:\\image", @@ -30,7 +29,11 @@ "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", "announcements": "{{env `ANNOUNCEMENTS`}}" }, - "sensitive-variables": ["install_password", "client_secret", "github_feed_token"], + "sensitive-variables": [ + "install_password", + "client_secret", + "github_feed_token" + ], "builders": [ { "name": "vhd", @@ -65,7 +68,7 @@ "provisioners": [ { "type": "powershell", - "inline":[ + "inline": [ "New-Item -Path {{user `image_folder`}} -ItemType Directory -Force" ] }, @@ -97,7 +100,7 @@ { "type": "windows-shell", "inline": [ - "net user {{user `install_user`}} {{user `install_password`}} /add /passwordchg:no /passwordreq:yes /active:yes /Y" , + "net user {{user `install_user`}} {{user `install_password`}} /add /passwordchg:no /passwordreq:yes /active:yes /Y", "net localgroup Administrators {{user `install_user`}} /add", "winrm set winrm/config/service/auth @{Basic=\"true\"}", "winrm get winrm/config/service/auth" @@ -116,7 +119,7 @@ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1", "{{ template_dir }}/scripts/Installers/Initialize-VM.ps1", "{{ template_dir }}/scripts/Installers/Install-WebPlatformInstaller.ps1" @@ -127,13 +130,13 @@ "type": "powershell", "elevated_user": "SYSTEM", "elevated_password": "", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-DotnetTLS.ps1", "{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1" ] @@ -141,8 +144,8 @@ { "type": "powershell", "inline": [ - "setx ImageVersion {{user `image_version` }} /m", - "setx ImageOS {{user `image_os` }} /m" + "setx ImageVersion {{user `image_version` }} /m", + "setx ImageOS {{user `image_os` }} /m" ] }, { @@ -155,7 +158,7 @@ "IMAGE_VERSION={{user `image_version`}}", "IMAGEDATA_FILE={{user `imagedata_file`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-ImageData.ps1", "{{ template_dir }}/scripts/Installers/Install-Docker.ps1", "{{ template_dir }}/scripts/Installers/Install-PowershellCore.ps1" @@ -167,7 +170,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1" ] }, @@ -177,10 +180,10 @@ 0, 3010 ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-VS.ps1", "{{ template_dir }}/scripts/Installers/Install-NET48.ps1" ], @@ -189,10 +192,10 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1", "{{ template_dir }}/scripts/Installers/Install-Wix.ps1", "{{ template_dir }}/scripts/Installers/Install-WDK.ps1", @@ -209,7 +212,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" ], "execution_policy": "remotesigned" @@ -220,38 +223,39 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "GITHUB_FEED_TOKEN={{ user `github_feed_token` }}", "ROOT_FOLDER={{user `root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Download-ToolCache.ps1" ] }, { "type": "windows-shell", - "inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"] + "inline": [ + "wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive" + ] }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "ROOT_FOLDER={{user `root_folder`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-PyPy.ps1", "{{ template_dir }}/scripts/Installers/Install-Toolset.ps1", "{{ template_dir }}/scripts/Installers/Configure-Toolset.ps1", "{{ template_dir }}/scripts/Installers/Install-YAMLLint.ps1", "{{ template_dir }}/scripts/Installers/Update-AndroidSDK.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureModules.ps1" - ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-OpenSSL.ps1", "{{ template_dir }}/scripts/Installers/Install-Perl.ps1", "{{ template_dir }}/scripts/Installers/Install-Git.ps1", @@ -270,7 +274,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Enable-DeveloperMode.ps1" ], "elevated_user": "{{user `install_user`}}", @@ -280,13 +284,13 @@ "type": "powershell", "elevated_user": "SYSTEM", "elevated_password": "", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-Msys2.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-VSWhere.ps1", "{{ template_dir }}/scripts/Installers/Install-WinAppDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-Cmake.ps1", @@ -322,7 +326,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1", "{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1" ], @@ -335,10 +339,10 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Tests/RunAll-Tests.ps1" ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}", "ROOT_FOLDER={{user `root_folder`}}" @@ -349,7 +353,7 @@ "inline": [ "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" ], - "environment_vars":[ + "environment_vars": [ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "ANNOUNCEMENTS={{user `announcements`}}" ] @@ -362,7 +366,7 @@ }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Finalize-VM.ps1" ] }, @@ -372,28 +376,28 @@ }, { "type": "powershell", - "environment_vars":[ + "environment_vars": [ "RUN_SCAN_ANTIVIRUS={{user `run_scan_antivirus`}}" ], - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Run-Antivirus.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" ] }, { "type": "powershell", - "scripts":[ + "scripts": [ "{{ template_dir }}/scripts/Installers/Run-NGen.ps1" ] }, From b3251e95a88e6d6d4f4cedbd74a512e3785dc2f6 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 22 Sep 2020 15:21:08 +0700 Subject: [PATCH 02/51] vsmac added latest flag --- images/macos/provision/core/vsmac.sh | 3 +++ images/macos/toolsets/toolset-10.15.json | 2 +- images/macos/toolsets/toolset-11.0.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/core/vsmac.sh b/images/macos/provision/core/vsmac.sh index 9774e486f..3be149e25 100644 --- a/images/macos/provision/core/vsmac.sh +++ b/images/macos/provision/core/vsmac.sh @@ -3,6 +3,9 @@ source ~/utils/utils.sh source ~/utils/xamarin-utils.sh VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac') +if [ VSMAC_VERSION == 'latest' ] + then + VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version) VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION) TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX` diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index e7b17989f..39ee290fc 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -6,7 +6,7 @@ ] }, "xamarin": { - "vsmac": "8.7.7.10", + "vsmac": "latest", "mono-versions": [ "6.12.0.93", "6.10.0.106", "6.8.0.123", "6.6.0.166", "6.4.0.208" ], diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index fa7a65a5a..b4ca5c82d 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -6,7 +6,7 @@ ] }, "xamarin": { - "vsmac": "8.7.7.10", + "vsmac": "latest", "mono-versions": [ "6.12.0.93" ], From 3e0cb719c7631369654ea14401edf013e8f8e6ae Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 22 Sep 2020 15:31:29 +0700 Subject: [PATCH 03/51] copy issue. --- images/macos/provision/core/vsmac.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/core/vsmac.sh b/images/macos/provision/core/vsmac.sh index 3be149e25..1ba0f6039 100644 --- a/images/macos/provision/core/vsmac.sh +++ b/images/macos/provision/core/vsmac.sh @@ -3,9 +3,9 @@ source ~/utils/utils.sh source ~/utils/xamarin-utils.sh VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac') -if [ VSMAC_VERSION == 'latest' ] - then +if [ VSMAC_VERSION == 'latest' ]; then VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version) +fi VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION) TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX` From d0860e2c374e03f63ca743be2964e87c99a08cf9 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Wed, 23 Sep 2020 01:41:19 +0700 Subject: [PATCH 04/51] change quotes --- images/macos/provision/core/vsmac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/core/vsmac.sh b/images/macos/provision/core/vsmac.sh index 1ba0f6039..89fa58184 100644 --- a/images/macos/provision/core/vsmac.sh +++ b/images/macos/provision/core/vsmac.sh @@ -3,7 +3,7 @@ source ~/utils/utils.sh source ~/utils/xamarin-utils.sh VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac') -if [ VSMAC_VERSION == 'latest' ]; then +if [ VSMAC_VERSION == "latest" ]; then VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version) fi VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION) From 3635bca3c247aa576c34e381eb65780f8b8135ce Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Thu, 24 Sep 2020 01:44:29 +0700 Subject: [PATCH 05/51] added latest version --- images/macos/provision/core/vsmac.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/core/vsmac.sh b/images/macos/provision/core/vsmac.sh index 89fa58184..20a8efd46 100644 --- a/images/macos/provision/core/vsmac.sh +++ b/images/macos/provision/core/vsmac.sh @@ -3,8 +3,8 @@ source ~/utils/utils.sh source ~/utils/xamarin-utils.sh VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac') -if [ VSMAC_VERSION == "latest" ]; then - VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version) +if [ $VSMAC_VERSION == "latest" ]; then + VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version | tr -d \") fi VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION) From 13b9879c7efe4dddd031f7458320e898e5686271 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 24 Sep 2020 11:09:23 +0300 Subject: [PATCH 06/51] add ANDROID_SDK_ROOT to windows --- images/win/scripts/Installers/Update-AndroidSDK.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index 5eeac22fc..b5b9a67f7 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -71,6 +71,7 @@ $ndkRoot = "C:\Program Files (x86)\Android\android-sdk\ndk-bundle" if (Test-Path $ndkRoot) { setx ANDROID_HOME $sdkRoot /M + setx ANDROID_SDK_ROOT $sdkRoot /M setx ANDROID_NDK_HOME $ndkRoot /M setx ANDROID_NDK_PATH $ndkRoot /M } else { From 046a1e5b713612a0699d13bd2b267cb67dfdf8db Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 24 Sep 2020 11:19:02 +0300 Subject: [PATCH 07/51] add ANDROID_SDK_ROOT to macOS --- images/macos/provision/configuration/environment/bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/images/macos/provision/configuration/environment/bashrc b/images/macos/provision/configuration/environment/bashrc index 26fd14327..92fe36d3d 100644 --- a/images/macos/provision/configuration/environment/bashrc +++ b/images/macos/provision/configuration/environment/bashrc @@ -3,6 +3,7 @@ export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export ANDROID_HOME=${HOME}/Library/Android/sdk +export ANDROID_SDK_ROOT=${HOME}/Library/Android/sdk export ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle export NUNIT_BASE_PATH=/Library/Developer/nunit From 207f49ed9343b65a01c0750a2e552d05a3bd985b Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Thu, 24 Sep 2020 13:01:25 +0300 Subject: [PATCH 08/51] add g++-10 --- .../linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 6 +++--- images/linux/scripts/installers/gcc.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 64a9d1c3f..267dcac3a 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -8,7 +8,7 @@ function Get-CPPVersions { $cppVersions = apt list --installed 2>&1 | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object { $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version - } + } | Sort-Object {[Version]$_} return "GNU C++ " + ($cppVersions -Join ", ") } @@ -16,7 +16,7 @@ function Get-FortranVersions { $fortranVersions = apt list --installed 2>&1 | Where-Object { $_ -match "^gfortran-\d+"} | ForEach-Object { $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version - } + } | Sort-Object {[Version]$_} return "GNU Fortran " + ($fortranVersions -Join ", ") } @@ -28,7 +28,7 @@ function Get-ClangVersions { $_ -match "clang version (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version } - } + } | Sort-Object {[Version]$_} return "Clang " + ($clangVersions -Join ", ") } diff --git a/images/linux/scripts/installers/gcc.sh b/images/linux/scripts/installers/gcc.sh index 7b1bd56ea..914c3e1e0 100644 --- a/images/linux/scripts/installers/gcc.sh +++ b/images/linux/scripts/installers/gcc.sh @@ -4,7 +4,6 @@ ## Desc: Installs GNU C++ ################################################################################ - function InstallGcc { version=$1 @@ -27,6 +26,7 @@ versions=( "g++-7" "g++-8" "g++-9" + "g++-10" ) for version in ${versions[*]} From 72bd7db479417c7aca8386daa2a7c86f5a945871 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Thu, 24 Sep 2020 20:49:22 +0300 Subject: [PATCH 09/51] exclude Ubuntu16 --- images/linux/scripts/installers/gcc.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/gcc.sh b/images/linux/scripts/installers/gcc.sh index 914c3e1e0..b59eae7f6 100644 --- a/images/linux/scripts/installers/gcc.sh +++ b/images/linux/scripts/installers/gcc.sh @@ -4,6 +4,11 @@ ## Desc: Installs GNU C++ ################################################################################ +set -e + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/os.sh + function InstallGcc { version=$1 @@ -26,10 +31,12 @@ versions=( "g++-7" "g++-8" "g++-9" - "g++-10" ) -for version in ${versions[*]} -do +if ! isUbuntu16; then + versions+=("g++-10") +fi + +for version in ${versions[*]}; do InstallGcc $version done From 1f73bc3e70a6591e632ba3466e2e2138e92f85b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 25 Sep 2020 12:41:45 +0300 Subject: [PATCH 10/51] fix markdown output --- images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 267dcac3a..c9257407f 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -6,8 +6,7 @@ function Get-OSName { function Get-CPPVersions { $cppVersions = apt list --installed 2>&1 | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object { - $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null - $Matches.version + & $_.Split("/")[0] --version | Select-Object -First 1 | Take-OutputPart -Part 3 } | Sort-Object {[Version]$_} return "GNU C++ " + ($cppVersions -Join ", ") } From e12653fe98f81f806ee07c8373172b8ea62b52e1 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 25 Sep 2020 14:08:34 +0300 Subject: [PATCH 11/51] Fix credentials in GenerateResourcesAndImage.ps1 --- helpers/GenerateResourcesAndImage.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/GenerateResourcesAndImage.ps1 b/helpers/GenerateResourcesAndImage.ps1 index 31d48ee65..2e773cec8 100644 --- a/helpers/GenerateResourcesAndImage.ps1 +++ b/helpers/GenerateResourcesAndImage.ps1 @@ -167,7 +167,9 @@ Function GenerateResourcesAndImage { New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" $spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper() - $sp = New-AzADServicePrincipal -DisplayName $spDisplayName -Password (ConvertTo-SecureString $ServicePrincipalClientSecret -AsPlainText -Force) + $credentials = New-Object -TypeName Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property @{ + StartDate=Get-Date; EndDate=Get-Date -Year 2024; Password=$ServicePrincipalClientSecret} + $sp = New-AzADServicePrincipal -DisplayName $spDisplayName -PasswordCredential $credentials $spAppId = $sp.ApplicationId $spClientId = $sp.ApplicationId From ec87362e809b1c7bfb31f755a3571f4955e20796 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 25 Sep 2020 10:47:43 +0300 Subject: [PATCH 12/51] add clang-tidy --- images/linux/scripts/installers/clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/clang.sh b/images/linux/scripts/installers/clang.sh index c81cfd2a3..377a3607f 100644 --- a/images/linux/scripts/installers/clang.sh +++ b/images/linux/scripts/installers/clang.sh @@ -12,11 +12,11 @@ function InstallClang { local version=$1 echo "Installing clang-$version..." - if [[ $version =~ (9|10) ]]; then + if [[ $version =~ 9 ]] && isUbuntu16; then ./llvm.sh $version apt-get install -y "clang-format-$version" else - apt-get install -y "clang-$version" "lldb-$version" "lld-$version" "clang-format-$version" + apt-get install -y "clang-$version" "lldb-$version" "lld-$version" apt-get install -y "clang-format-$version" fi # Run tests to determine that the software installed as expected From f7ff25aead04b45cfeb303e54bbf9bd0daa8ed22 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 25 Sep 2020 14:48:00 +0300 Subject: [PATCH 13/51] move to the official repository --- images/linux/scripts/installers/clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/clang.sh b/images/linux/scripts/installers/clang.sh index 377a3607f..4a3424fd4 100644 --- a/images/linux/scripts/installers/clang.sh +++ b/images/linux/scripts/installers/clang.sh @@ -16,7 +16,7 @@ function InstallClang { ./llvm.sh $version apt-get install -y "clang-format-$version" else - apt-get install -y "clang-$version" "lldb-$version" "lld-$version" apt-get install -y "clang-format-$version" + apt-get install -y "clang-$version" "lldb-$version" "lld-$version" "clang-format-$version" fi # Run tests to determine that the software installed as expected From 745e5b45ffbd5c5a16012f7fda9e675bc81d38b4 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 25 Sep 2020 15:00:21 +0300 Subject: [PATCH 14/51] Fix code style --- helpers/GenerateResourcesAndImage.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/GenerateResourcesAndImage.ps1 b/helpers/GenerateResourcesAndImage.ps1 index 2e773cec8..9718bc35a 100644 --- a/helpers/GenerateResourcesAndImage.ps1 +++ b/helpers/GenerateResourcesAndImage.ps1 @@ -167,8 +167,8 @@ Function GenerateResourcesAndImage { New-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" $spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper() - $credentials = New-Object -TypeName Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property @{ - StartDate=Get-Date; EndDate=Get-Date -Year 2024; Password=$ServicePrincipalClientSecret} + $credentialProperties = @{ StartDate=Get-Date; EndDate=Get-Date -Year 2024; Password=$ServicePrincipalClientSecret } + $credentials = New-Object -TypeName Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property $credentialProperties $sp = New-AzADServicePrincipal -DisplayName $spDisplayName -PasswordCredential $credentials $spAppId = $sp.ApplicationId From b998ade09bb57e0ca1f2c19ff11c1a01f0302ce8 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Fri, 25 Sep 2020 15:41:31 +0300 Subject: [PATCH 15/51] disable indexing --- images/macos/provision/configuration/configure-machine.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/configuration/configure-machine.sh b/images/macos/provision/configuration/configure-machine.sh index dbfae6731..81946f01e 100644 --- a/images/macos/provision/configuration/configure-machine.sh +++ b/images/macos/provision/configuration/configure-machine.sh @@ -27,4 +27,7 @@ sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885 # sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain curl https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer --output $HOME/AppleWWDRCAG3.cer --silent sudo security add-trusted-cert -d -r unspecified -k /Library/Keychains/System.keychain $HOME/AppleWWDRCAG3.cer -rm $HOME/AppleWWDRCAG3.cer \ No newline at end of file +rm $HOME/AppleWWDRCAG3.cer + +# Disable spotlight indexing to prevent possible high CPU usage after startup +sudo mdutil -ai off \ No newline at end of file From 658a6a66425e85de43b66076eeca37762087a328 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Fri, 25 Sep 2020 16:25:39 +0300 Subject: [PATCH 16/51] add azure powershell v4.7.0 --- images/linux/toolsets/toolset-1604.json | 3 ++- images/linux/toolsets/toolset-1804.json | 3 ++- images/win/toolsets/toolset-2016.json | 3 ++- images/win/toolsets/toolset-2019.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/images/linux/toolsets/toolset-1604.json b/images/linux/toolsets/toolset-1604.json index c8b2b1510..46aad66ad 100644 --- a/images/linux/toolsets/toolset-1604.json +++ b/images/linux/toolsets/toolset-1604.json @@ -109,7 +109,8 @@ "3.8.0", "4.3.0", "4.4.0", - "4.6.0" + "4.6.0", + "4.7.0" ] } ], diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 6311cc1a1..2670b4cf3 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -105,7 +105,8 @@ "3.8.0", "4.3.0", "4.4.0", - "4.6.0" + "4.6.0", + "4.7.0" ] } ], diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index c764e0802..856df7527 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -121,7 +121,8 @@ "3.8.0", "4.3.0", "4.4.0", - "4.6.0" + "4.6.0", + "4.7.0" ] } ], diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 7184dc037..20f05bf87 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -130,7 +130,8 @@ "3.8.0", "4.3.0", "4.4.0", - "4.6.0" + "4.6.0", + "4.7.0" ] } ], From c49245208d51cb436461a692394c30d2aa5af75a Mon Sep 17 00:00:00 2001 From: Hutson Betts Date: Fri, 25 Sep 2020 12:49:52 -0500 Subject: [PATCH 17/51] fix(win): use correct case sensitive file name File name was submitted with `CLI` in `AzureDevSpacesCLI` capitalized, but the script is invoked as a provisioner using the lower-case `Cli` form as seen in `AzureDevSpacesCli`. Renaming the file to use the lower-case form to match other provisioning scripts used in the Windows builds. Issue introduced in commit 932d0f36cdabe7e40fc8abb46469dcee1922b252 --- ...nstall-AzureDevSpacesCLI.ps1 => Install-AzureDevSpacesCli.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename images/win/scripts/Installers/{Install-AzureDevSpacesCLI.ps1 => Install-AzureDevSpacesCli.ps1} (100%) diff --git a/images/win/scripts/Installers/Install-AzureDevSpacesCLI.ps1 b/images/win/scripts/Installers/Install-AzureDevSpacesCli.ps1 similarity index 100% rename from images/win/scripts/Installers/Install-AzureDevSpacesCLI.ps1 rename to images/win/scripts/Installers/Install-AzureDevSpacesCli.ps1 From 8c52f59c23d43473786aa30fd881ee2dddcb6e64 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Sun, 27 Sep 2020 21:40:56 +0500 Subject: [PATCH 18/51] Add json & md linting with github/super-linter --- .github/workflows/linter.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..376b5f25a --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,27 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + pull_request: + branches: [main] + +jobs: + build: + name: Lint JSON & MD files + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Lint Code Base + uses: github/super-linter@v3 + env: + VALIDATE_ALL_CODEBASE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_JSON: true + VALIDATE_MD: true + DEFAULT_BRANCH: main From 0cc7e14e5ea615c1f1be8dac1f927b9b314f492c Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Mon, 28 Sep 2020 12:36:43 +0500 Subject: [PATCH 19/51] Change descriptive comment --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 376b5f25a..ea1eb7855 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,4 +1,4 @@ -# This is a basic workflow to help you get started with Actions +# CI Validation name: CI From f102789f9fb69a9ae8e0f589aed7c3944cc4a394 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Mon, 28 Sep 2020 12:37:31 +0500 Subject: [PATCH 20/51] remove redundant comments --- .github/workflows/linter.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ea1eb7855..461611bba 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -2,8 +2,6 @@ name: CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: pull_request: branches: [main] From 258e8cd8177fcc559226192b40238c0134e7ffc5 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Mon, 28 Sep 2020 12:40:36 +0500 Subject: [PATCH 21/51] replace "main" with "$default-branch" --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 461611bba..42eb7cad8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,7 +4,7 @@ name: CI on: pull_request: - branches: [main] + branches: [$default-branch] jobs: build: @@ -22,4 +22,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_JSON: true VALIDATE_MD: true - DEFAULT_BRANCH: main + DEFAULT_BRANCH: ${{ github.base_ref }} From 79beb8514c6bd92d83e5a237500423b058c0454d Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 28 Sep 2020 12:50:18 +0300 Subject: [PATCH 22/51] fix Get-CodeQLBundleVersion output --- images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 2 ++ images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 28a07dce9..2f45ecde1 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -1,3 +1,5 @@ +$ErrorActionPreference = "Stop" + Import-Module MarkdownPS Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 85c73c151..0c0f39f55 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -34,7 +34,7 @@ function Get-CodeQLBundleVersion { $CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*" $CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName $CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe" - $CodeQLVersion = $($CodeQLPath version --quiet) + $CodeQLVersion = & $CodeQLPath version --quiet return "CodeQL Action Bundle $CodeQLVersion" } From 0c3f2ac159d715800936d481bed2b6b25f8c2aff Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 29 Sep 2020 10:57:30 +0300 Subject: [PATCH 23/51] moved the list of docker images to toolset --- .../scripts/Installers/Update-DockerImages.ps1 | 17 +++-------------- images/win/toolsets/toolset-2016.json | 9 +++++++++ images/win/toolsets/toolset-2019.json | 9 +++++++++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/images/win/scripts/Installers/Update-DockerImages.ps1 b/images/win/scripts/Installers/Update-DockerImages.ps1 index d1a689d45..ec5df1b4a 100644 --- a/images/win/scripts/Installers/Update-DockerImages.ps1 +++ b/images/win/scripts/Installers/Update-DockerImages.ps1 @@ -16,18 +16,7 @@ function DockerPull { } } -if (Test-IsWin16) { - DockerPull mcr.microsoft.com/windows/servercore:ltsc2016 - DockerPull mcr.microsoft.com/windows/nanoserver:10.0.14393.953 - DockerPull mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016 - DockerPull mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016 +$dockerToolset = (Get-ToolsetContent).docker +foreach($dockerImage in $dockerToolset.images) { + DockerPull $dockerImage } - -if (Test-IsWin19) { - DockerPull mcr.microsoft.com/windows/servercore:ltsc2019 - DockerPull mcr.microsoft.com/windows/nanoserver:1809 - DockerPull mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 - DockerPull mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 -} - -DockerPull microsoft/aspnetcore-build:1.0-2.0 diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index 856df7527..c3702c599 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -231,5 +231,14 @@ ], "vsix": [ ] + }, + "docker": { + "images": [ + "mcr.microsoft.com/windows/servercore:ltsc2016", + "mcr.microsoft.com/windows/nanoserver:10.0.14393.953", + "mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016", + "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016", + "microsoft/aspnetcore-build:1.0-2.0" + ] } } diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 20f05bf87..f431836f6 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -283,5 +283,14 @@ "id": "VSInstallerProjects" } ] + }, + "docker": { + "images": [ + "mcr.microsoft.com/windows/servercore:ltsc2019", + "mcr.microsoft.com/windows/nanoserver:1809", + "mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019", + "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019", + "microsoft/aspnetcore-build:1.0-2.0" + ] } } From 6b13fc34bcd10f93305a741aecf0c34e55ef31e6 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 29 Sep 2020 13:49:41 +0300 Subject: [PATCH 24/51] use dynamic lists for platforms and build-tools --- .../scripts/Installers/Update-AndroidSDK.ps1 | 24 ++++++++++++++----- .../SoftwareReport.Android.psm1 | 5 ++++ images/win/scripts/Tests/Android.Tests.ps1 | 15 ++++++++---- images/win/toolsets/toolset-2016.json | 8 ++----- images/win/toolsets/toolset-2019.json | 8 ++----- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index b5b9a67f7..f64d50e32 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -3,6 +3,7 @@ ## Desc: Install and update Android SDK and tools ################################################################################ +$ErrorActionPreference = "Stop" # Download the latest command line tools so that we can accept all of the licenses. # See https://developer.android.com/studio/#command-tools $sdkArchPath = Start-DownloadWithRetry -Url "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -Name "android-sdk-tools.zip" @@ -42,15 +43,26 @@ $sdkManager = "$sdkRoot\tools\bin\sdkmanager.bat" & $sdkManager --sdk_root=$sdkRoot "platform-tools" -Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` - -AndroidSDKRootPath $sdkRoot ` - -AndroidPackages $androidToolset.platform_list ` - -PrefixPackageName "platforms;" +# get packages info +$androidPackages = & $sdkManager --list --verbose 2>&1 + +# platforms +[int]$platformMinVersion = $androidToolset.platform_min_version +$platformList = $androidPackages | Where-Object { "$_".StartsWith("platforms;") } | + Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique + +# build-tools +[version]$buildToolsMinVersion = $androidToolset.build_tools_min_version +$buildToolsList = $androidPackages | Where-Object { "$_".StartsWith("build-tools;") } | + Where-Object { [version]$_.Split(";")[1] -ge $buildToolsMinVersion } | Sort-Object { [version]$_.Split(";")[1] } -Unique Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` -AndroidSDKRootPath $sdkRoot ` - -AndroidPackages $androidToolset.build_tools ` - -PrefixPackageName "build-tools;" + -AndroidPackages $platformList + +Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` + -AndroidSDKRootPath $sdkRoot ` + -AndroidPackages $buildToolsList Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` -AndroidSDKRootPath $sdkRoot ` diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 index f85423c2c..dd59f77f4 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 @@ -31,6 +31,11 @@ function Get-AndroidInstalledPackages { return $androidInstalledPackages } +function Get-AndroidPackages { + $androidSDKManagerPath = Get-AndroidSDKManagerPath + $androidPackages = & $androidSDKManagerPath --list --verbose + return $androidPackages +} function Build-AndroidTable { $packageInfo = Get-AndroidInstalledPackages diff --git a/images/win/scripts/Tests/Android.Tests.ps1 b/images/win/scripts/Tests/Android.Tests.ps1 index 8a1b6c0bb..e90ad6828 100644 --- a/images/win/scripts/Tests/Android.Tests.ps1 +++ b/images/win/scripts/Tests/Android.Tests.ps1 @@ -2,16 +2,21 @@ Import-Module (Join-Path $PSScriptRoot "..\SoftwareReport\SoftwareReport.Android Describe "Android SDK" { $androidToolset = (Get-ToolsetContent).android + $androidPackages = Get-AndroidPackages $androidInstalledPackages = Get-AndroidInstalledPackages $platformTestCases = @() - $platformList = $androidToolset.platform_list + [int]$platformMinVersion = $androidToolset.platform_min_version + $platformList = $androidPackages | Where-Object { "$_".StartsWith("platforms;") } | + Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique $platformList | ForEach-Object { $platformTestCases += @{ platformVersion = $_; installedPackages = $androidInstalledPackages } } $buildToolsTestCases = @() - $buildToolsList = $androidToolset.build_tools + [version]$buildToolsMinVersion = $androidToolset.build_tools_min_version + $buildToolsList = $androidPackages | Where-Object { "$_".StartsWith("build-tools;") } | + Where-Object { [version]$_.Split(";")[1] -ge $buildToolsMinVersion } | Sort-Object { [version]$_.Split(";")[1] } -Unique $buildToolsList | ForEach-Object { $buildToolsTestCases += @{ buildToolsVersion = $_; installedPackages = $androidInstalledPackages } } @@ -35,14 +40,14 @@ Describe "Android SDK" { } It "Platform version is installed" -TestCases $platformTestCases { - "$installedPackages" | Should -Match "platforms;$platformVersion" + "$installedPackages" | Should -Match "$platformVersion" } It "Platform build tools is installed" -TestCases $buildToolsTestCases { - "$installedPackages" | Should -Match "build-tools;$buildToolsVersion" + "$installedPackages" | Should -Match "$buildToolsVersion" } - if (Test-isWin19) { + if (Test-IsWin19) { It "Extra package is installed" -TestCases $extraPackagesTestCases { "$installedPackages" | Should -Match "extras;$extraPackage" } diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index 856df7527..ea1fa7d9b 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -127,12 +127,8 @@ } ], "android": { - "platform_list": [ - "android-30", "android-29", "android-28", "android-27", "android-26", "android-25", "android-24", "android-23", "android-22", "android-21", "android-19" - ], - "build_tools": [ - "30.0.2", "30.0.1", "30.0.0", "29.0.3", "29.0.2", "29.0.1", "29.0.0", "28.0.3", "28.0.2", "28.0.1", "28.0.0", "27.0.3", "27.0.2", "27.0.1", "27.0.0", "26.0.3", "26.0.2", "26.0.1", "26.0.0", "25.0.3", "25.0.2", "25.0.1", "25.0.0", "24.0.3", "24.0.2", "24.0.1", "24.0.0", "23.0.3", "23.0.2", "23.0.1", "22.0.1", "21.1.2", "20.0.0", "19.1.0" - ], + "platform_min_version": "19", + "build_tools_min_version": "19.1.0", "extra_list": [ "android;m2repository", "google;m2repository", diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 20f05bf87..64a0b0182 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -136,12 +136,8 @@ } ], "android": { - "platform_list": [ - "android-30", "android-29", "android-28", "android-27", "android-26", "android-25", "android-24", "android-23", "android-22", "android-21", "android-19" - ], - "build_tools": [ - "30.0.2", "30.0.1", "30.0.0", "29.0.3", "29.0.2", "29.0.1", "29.0.0", "28.0.3", "28.0.2", "28.0.1", "28.0.0", "27.0.3", "27.0.2", "27.0.1", "27.0.0", "26.0.3", "26.0.2", "26.0.1", "26.0.0", "25.0.3", "25.0.2", "25.0.1", "25.0.0", "24.0.3", "24.0.2", "24.0.1", "24.0.0", "23.0.3", "23.0.2", "23.0.1", "22.0.1", "21.1.2", "20.0.0", "19.1.0" - ], + "platform_min_version": "19", + "build_tools_min_version": "19.1.0", "extra_list": [ "android;m2repository", "google;m2repository", From bac163a71bdb60285e49158c0dc60ee54099d53e Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 29 Sep 2020 18:13:37 +0300 Subject: [PATCH 25/51] move mms provisioner scripts --- .../Add-SshHostKeys.ps1 | 4 ++ .../Create-Junction.ps1 | 30 ++++++++++++++ .../Remove-AzureRegistrySettings.ps1 | 9 +++++ .../Set-RunnerToolCache.ps1 | 14 +++++++ .../Update-VSConfiguration.ps1 | 4 ++ .../Update-WindowsPath.ps1 | 39 +++++++++++++++++++ 6 files changed, 100 insertions(+) create mode 100644 images/win/afterDeploymentActions/Add-SshHostKeys.ps1 create mode 100644 images/win/afterDeploymentActions/Create-Junction.ps1 create mode 100644 images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 create mode 100644 images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 create mode 100644 images/win/afterDeploymentActions/Update-VSConfiguration.ps1 create mode 100644 images/win/afterDeploymentActions/Update-WindowsPath.ps1 diff --git a/images/win/afterDeploymentActions/Add-SshHostKeys.ps1 b/images/win/afterDeploymentActions/Add-SshHostKeys.ps1 new file mode 100644 index 000000000..2ddeb1310 --- /dev/null +++ b/images/win/afterDeploymentActions/Add-SshHostKeys.ps1 @@ -0,0 +1,4 @@ +# 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 dsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" \ No newline at end of file diff --git a/images/win/afterDeploymentActions/Create-Junction.ps1 b/images/win/afterDeploymentActions/Create-Junction.ps1 new file mode 100644 index 000000000..a41f0f0c5 --- /dev/null +++ b/images/win/afterDeploymentActions/Create-Junction.ps1 @@ -0,0 +1,30 @@ +# Create Rust junction points to cargo and rustup folder +$cargoTarget = "$env:USERPROFILE\.cargo" +if (-not (Test-Path $cargoTarget)) +{ + New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo" + + if (Test-Path $cargoTarget) + { + Write-Host "Junction created for $cargoTarget <<===>> C:\Rust\.cargo" + } + else + { + Write-Host "Junction was not created for $cargoTarget" + } +} + +$rustupTarget = "$env:USERPROFILE\.rustup" +if (-not (Test-Path $rustupTarget)) +{ + New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup" + + if (Test-Path $rustupTarget) + { + Write-Host "Junction created for $rustupTarget <<===>> C:\Rust\.rustup" + } + else + { + Write-Host "Junction was not created for $rustupTarget" + } +} \ No newline at end of file diff --git a/images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 b/images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 new file mode 100644 index 000000000..d59f5375f --- /dev/null +++ b/images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 @@ -0,0 +1,9 @@ +# Script to address any current issues with images that could be easily worked around. +$ErrorActionPreference="Stop" + +# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a +# race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines. +# ICM: https://portal.microsofticm.com/imp/v3/incidents/details/191973270/home +Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore +Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore +Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore diff --git a/images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 b/images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 new file mode 100644 index 000000000..3f11343ce --- /dev/null +++ b/images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 @@ -0,0 +1,14 @@ +if ([string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE)) +{ + $env:RUNNER_TOOL_CACHE=$env:AGENT_TOOLSDIRECTORY + [System.Environment]::SetEnvironmentVariable('RUNNER_TOOL_CACHE', $env:AGENT_TOOLSDIRECTORY, [System.EnvironmentVariableTarget]::Machine) + Write-Host "RUNNER_TOOL_CACHE set to match AGENT_TOOLSDIRECTORY: $env:RUNNER_TOOL_CACHE" + + [System.Environment]::SetEnvironmentVariable('AGENT_TOOLSDIRECTORY', $null, [System.EnvironmentVariableTarget]::Machine) + $isAgentToolsDirectoryNotThere = [string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE) + Write-Host "AGENT_TOOLSDIRECTORY deleted: $isAgentToolsDirectoryNotThere" +} +else +{ + Write-Host "RUNNER_TOOL_CACHE non-empty: $env:RUNNER_TOOL_CACHE" +} diff --git a/images/win/afterDeploymentActions/Update-VSConfiguration.ps1 b/images/win/afterDeploymentActions/Update-VSConfiguration.ps1 new file mode 100644 index 000000000..0ff9d7bfb --- /dev/null +++ b/images/win/afterDeploymentActions/Update-VSConfiguration.ps1 @@ -0,0 +1,4 @@ +$vsInstallRoot = Get-VisualStudioPath +$devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe" + +cmd.exe /c "`"$devEnvPath`" /updateconfiguration" \ No newline at end of file diff --git a/images/win/afterDeploymentActions/Update-WindowsPath.ps1 b/images/win/afterDeploymentActions/Update-WindowsPath.ps1 new file mode 100644 index 000000000..ef84a6e25 --- /dev/null +++ b/images/win/afterDeploymentActions/Update-WindowsPath.ps1 @@ -0,0 +1,39 @@ +$isPathUpdated = $false +$hgPath = "$Env:ProgramFiles\Mercurial\" +$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) + +if (Test-Path -Path $hgPath) +{ + $latestPath = "$hgPath;$latestPath" + Write-Host "Added Mercurial to PATH" + $isPathUpdated = $true +} +else +{ + Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it." +} + +$dotnetPath = "$env:USERPROFILE\.dotnet\tools" +if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) +{ + $latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath") + $isPathUpdated = $true +} + +if (-not $latestPath.Contains($dotnetPath)) +{ + $latestPath = "$dotnetPath;$latestPath" + Write-Host "Added .dotnet\tools $dotnetPath to PATH" + $isPathUpdated = $true +} +else +{ + Write-Host "$dotnetPath already in PATH" +} + +if ($isPathUpdated) +{ + [System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) +} +$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) +Write-Host "Windows PATH: $updatedPath" \ No newline at end of file From 94c7463a7f6af79d630ac981ce7e7ba318e9b0ef Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 29 Sep 2020 18:16:37 +0300 Subject: [PATCH 26/51] rename folder --- .../Add-SshHostKeys.ps1 | 0 .../Create-Junction.ps1 | 0 .../Remove-AzureRegistrySettings.ps1 | 0 .../Set-RunnerToolCache.ps1 | 0 .../Update-VSConfiguration.ps1 | 0 .../Update-WindowsPath.ps1 | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename images/win/{afterDeploymentActions => post-generation}/Add-SshHostKeys.ps1 (100%) rename images/win/{afterDeploymentActions => post-generation}/Create-Junction.ps1 (100%) rename images/win/{afterDeploymentActions => post-generation}/Remove-AzureRegistrySettings.ps1 (100%) rename images/win/{afterDeploymentActions => post-generation}/Set-RunnerToolCache.ps1 (100%) rename images/win/{afterDeploymentActions => post-generation}/Update-VSConfiguration.ps1 (100%) rename images/win/{afterDeploymentActions => post-generation}/Update-WindowsPath.ps1 (100%) diff --git a/images/win/afterDeploymentActions/Add-SshHostKeys.ps1 b/images/win/post-generation/Add-SshHostKeys.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Add-SshHostKeys.ps1 rename to images/win/post-generation/Add-SshHostKeys.ps1 diff --git a/images/win/afterDeploymentActions/Create-Junction.ps1 b/images/win/post-generation/Create-Junction.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Create-Junction.ps1 rename to images/win/post-generation/Create-Junction.ps1 diff --git a/images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 b/images/win/post-generation/Remove-AzureRegistrySettings.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Remove-AzureRegistrySettings.ps1 rename to images/win/post-generation/Remove-AzureRegistrySettings.ps1 diff --git a/images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 b/images/win/post-generation/Set-RunnerToolCache.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Set-RunnerToolCache.ps1 rename to images/win/post-generation/Set-RunnerToolCache.ps1 diff --git a/images/win/afterDeploymentActions/Update-VSConfiguration.ps1 b/images/win/post-generation/Update-VSConfiguration.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Update-VSConfiguration.ps1 rename to images/win/post-generation/Update-VSConfiguration.ps1 diff --git a/images/win/afterDeploymentActions/Update-WindowsPath.ps1 b/images/win/post-generation/Update-WindowsPath.ps1 similarity index 100% rename from images/win/afterDeploymentActions/Update-WindowsPath.ps1 rename to images/win/post-generation/Update-WindowsPath.ps1 From ed6029487265f40684a771b6eb672e3c833689fa Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Wed, 30 Sep 2020 10:09:54 +0300 Subject: [PATCH 27/51] [macOS] Hardcode PyPy 7.3.1 for macOS-10.13 (#1693) * remove workaround + install 7.3.1 for hs * get back workaround for 7.3.1 * change order --- images/macos/provision/core/pypy.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/images/macos/provision/core/pypy.sh b/images/macos/provision/core/pypy.sh index a57f0ebb0..5f24cd5f5 100644 --- a/images/macos/provision/core/pypy.sh +++ b/images/macos/provision/core/pypy.sh @@ -66,16 +66,20 @@ function InstallPyPy rm -f $PACKAGE_TAR_TEMP_PATH } -# PyPy 7.3.1 relies on system libffi.6.dylib, which is not existed in in libffi 3.3 release. As a workaround symlink can be created -ln -s libffi.7.dylib /usr/local/opt/libffi/lib/libffi.6.dylib - uri="https://downloads.python.org/pypy/" pypyVersions=$(curl -4 -s --compressed $uri | grep 'osx64' | awk -v uri="$uri" -F'>|<' '{print uri$5}') - toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .versions[]') +versionPattern="v[0-9]+\.[0-9]+\.[0-9]+-" + +# PyPy 7.3.2 for High Sierra is broken, use 7.3.1 instead https://foss.heptapod.net/pypy/pypy/-/issues/3311 +if is_HighSierra; then + versionPattern="v7.3.1-" + # PyPy 7.3.1 relies on system libffi.6.dylib, which is not existed in in libffi 3.3 release. As a workaround symlink can be created + ln -s libffi.7.dylib /usr/local/opt/libffi/lib/libffi.6.dylib +fi for toolsetVersion in $toolsetVersions; do - latestMajorPyPyVersion=$(echo "${pypyVersions}" | grep -E "pypy${toolsetVersion}-v[0-9]+\.[0-9]+\.[0-9]+-" | head -1) + latestMajorPyPyVersion=$(echo "${pypyVersions}" | grep -E "pypy${toolsetVersion}-${versionPattern}" | head -1) if [[ -z "$latestMajorPyPyVersion" ]]; then echo "Failed to get PyPy version '$toolsetVersion'" exit 1 From 2a76bb378f800766285a5a79d740bf55462a96af Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 10:11:33 +0300 Subject: [PATCH 28/51] remove stderr 2>&1 --- images/win/scripts/Installers/Update-AndroidSDK.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index f64d50e32..e708c6dbc 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -44,7 +44,7 @@ $sdkManager = "$sdkRoot\tools\bin\sdkmanager.bat" & $sdkManager --sdk_root=$sdkRoot "platform-tools" # get packages info -$androidPackages = & $sdkManager --list --verbose 2>&1 +$androidPackages = & $sdkManager --list --verbose # platforms [int]$platformMinVersion = $androidToolset.platform_min_version From 85b60d074cd4e7106ea37b6de7b00b5d3ac3a3be Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Wed, 30 Sep 2020 12:34:36 +0300 Subject: [PATCH 29/51] resolve comments --- .../win/post-generation/Add-SshHostKeys.ps1 | 2 +- .../win/post-generation/Create-Junction.ps1 | 30 ------------------- .../post-generation/Create-RustJunction.ps1 | 12 ++++++++ .../Remove-AzureRegistrySettings.ps1 | 4 +-- .../post-generation/Set-RunnerToolCache.ps1 | 14 --------- ...-WindowsPath.ps1 => Update-DotnetPath.ps1} | 17 ----------- .../post-generation/Update-MercurialPath.ps1 | 16 ++++++++++ 7 files changed, 30 insertions(+), 65 deletions(-) delete mode 100644 images/win/post-generation/Create-Junction.ps1 create mode 100644 images/win/post-generation/Create-RustJunction.ps1 delete mode 100644 images/win/post-generation/Set-RunnerToolCache.ps1 rename images/win/post-generation/{Update-WindowsPath.ps1 => Update-DotnetPath.ps1} (61%) create mode 100644 images/win/post-generation/Update-MercurialPath.ps1 diff --git a/images/win/post-generation/Add-SshHostKeys.ps1 b/images/win/post-generation/Add-SshHostKeys.ps1 index 2ddeb1310..114a98d6a 100644 --- a/images/win/post-generation/Add-SshHostKeys.ps1 +++ b/images/win/post-generation/Add-SshHostKeys.ps1 @@ -1,4 +1,4 @@ # 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 dsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" \ No newline at end of file +ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" \ No newline at end of file diff --git a/images/win/post-generation/Create-Junction.ps1 b/images/win/post-generation/Create-Junction.ps1 deleted file mode 100644 index a41f0f0c5..000000000 --- a/images/win/post-generation/Create-Junction.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -# Create Rust junction points to cargo and rustup folder -$cargoTarget = "$env:USERPROFILE\.cargo" -if (-not (Test-Path $cargoTarget)) -{ - New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo" - - if (Test-Path $cargoTarget) - { - Write-Host "Junction created for $cargoTarget <<===>> C:\Rust\.cargo" - } - else - { - Write-Host "Junction was not created for $cargoTarget" - } -} - -$rustupTarget = "$env:USERPROFILE\.rustup" -if (-not (Test-Path $rustupTarget)) -{ - New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup" - - if (Test-Path $rustupTarget) - { - Write-Host "Junction created for $rustupTarget <<===>> C:\Rust\.rustup" - } - else - { - Write-Host "Junction was not created for $rustupTarget" - } -} \ No newline at end of file diff --git a/images/win/post-generation/Create-RustJunction.ps1 b/images/win/post-generation/Create-RustJunction.ps1 new file mode 100644 index 000000000..86f3fc106 --- /dev/null +++ b/images/win/post-generation/Create-RustJunction.ps1 @@ -0,0 +1,12 @@ +# Create Rust junction points to cargo and rustup folder +$cargoTarget = "$env:USERPROFILE\.cargo" +if (-not (Test-Path $cargoTarget)) +{ + New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo" +} + +$rustupTarget = "$env:USERPROFILE\.rustup" +if (-not (Test-Path $rustupTarget)) +{ + New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup" +} \ No newline at end of file diff --git a/images/win/post-generation/Remove-AzureRegistrySettings.ps1 b/images/win/post-generation/Remove-AzureRegistrySettings.ps1 index d59f5375f..e3a62d372 100644 --- a/images/win/post-generation/Remove-AzureRegistrySettings.ps1 +++ b/images/win/post-generation/Remove-AzureRegistrySettings.ps1 @@ -1,9 +1,7 @@ -# Script to address any current issues with images that could be easily worked around. $ErrorActionPreference="Stop" -# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a +# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a # race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines. -# ICM: https://portal.microsofticm.com/imp/v3/incidents/details/191973270/home Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore diff --git a/images/win/post-generation/Set-RunnerToolCache.ps1 b/images/win/post-generation/Set-RunnerToolCache.ps1 deleted file mode 100644 index 3f11343ce..000000000 --- a/images/win/post-generation/Set-RunnerToolCache.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -if ([string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE)) -{ - $env:RUNNER_TOOL_CACHE=$env:AGENT_TOOLSDIRECTORY - [System.Environment]::SetEnvironmentVariable('RUNNER_TOOL_CACHE', $env:AGENT_TOOLSDIRECTORY, [System.EnvironmentVariableTarget]::Machine) - Write-Host "RUNNER_TOOL_CACHE set to match AGENT_TOOLSDIRECTORY: $env:RUNNER_TOOL_CACHE" - - [System.Environment]::SetEnvironmentVariable('AGENT_TOOLSDIRECTORY', $null, [System.EnvironmentVariableTarget]::Machine) - $isAgentToolsDirectoryNotThere = [string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE) - Write-Host "AGENT_TOOLSDIRECTORY deleted: $isAgentToolsDirectoryNotThere" -} -else -{ - Write-Host "RUNNER_TOOL_CACHE non-empty: $env:RUNNER_TOOL_CACHE" -} diff --git a/images/win/post-generation/Update-WindowsPath.ps1 b/images/win/post-generation/Update-DotnetPath.ps1 similarity index 61% rename from images/win/post-generation/Update-WindowsPath.ps1 rename to images/win/post-generation/Update-DotnetPath.ps1 index ef84a6e25..c051ebd4a 100644 --- a/images/win/post-generation/Update-WindowsPath.ps1 +++ b/images/win/post-generation/Update-DotnetPath.ps1 @@ -1,18 +1,5 @@ -$isPathUpdated = $false -$hgPath = "$Env:ProgramFiles\Mercurial\" $latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) -if (Test-Path -Path $hgPath) -{ - $latestPath = "$hgPath;$latestPath" - Write-Host "Added Mercurial to PATH" - $isPathUpdated = $true -} -else -{ - Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it." -} - $dotnetPath = "$env:USERPROFILE\.dotnet\tools" if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) { @@ -31,9 +18,5 @@ else Write-Host "$dotnetPath already in PATH" } -if ($isPathUpdated) -{ - [System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) -} $updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) Write-Host "Windows PATH: $updatedPath" \ No newline at end of file diff --git a/images/win/post-generation/Update-MercurialPath.ps1 b/images/win/post-generation/Update-MercurialPath.ps1 new file mode 100644 index 000000000..de68e1812 --- /dev/null +++ b/images/win/post-generation/Update-MercurialPath.ps1 @@ -0,0 +1,16 @@ +$hgPath = "$Env:ProgramFiles\Mercurial\" +$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) + +if (Test-Path -Path $hgPath) +{ + $latestPath = "$hgPath;$latestPath" + Write-Host "Added Mercurial to PATH" + $isPathUpdated = $true +} +else +{ + Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it." +} + +$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) +Write-Host "Windows PATH: $updatedPath" \ No newline at end of file From e2fd93b6996a0c4db2e038f0972cf2320565e61e Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 14:56:59 +0300 Subject: [PATCH 30/51] remove download archive --- images/win/scripts/Installers/Update-AndroidSDK.ps1 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index e708c6dbc..a18f89ad7 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -4,14 +4,6 @@ ################################################################################ $ErrorActionPreference = "Stop" -# Download the latest command line tools so that we can accept all of the licenses. -# See https://developer.android.com/studio/#command-tools -$sdkArchPath = Start-DownloadWithRetry -Url "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -Name "android-sdk-tools.zip" - -# Don't replace the one that VS installs as it seems to break things. -Expand-Archive -Path $sdkArchPath -DestinationPath android-sdk -Force - -$sdk = Get-Item -Path .\android-sdk # Install the standard Android SDK licenses. In the past, there wasn't a better way to do this, # so we are base64-encoding a zip of the licenses directory from another installation. @@ -29,8 +21,7 @@ $sdk = Get-Item -Path .\android-sdk $base64Content = "UEsDBBQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAbGljZW5zZXMvYW5kcm9pZC1nb29nbGV0di1saWNlbnNlDQpmYzk0NmU4ZjIzMWYzZTMxNTliZjBiN2M2NTVjOTI0Y2IyZTM4MzMwUEsDBBQAAAAIAKBrN05E+YSqQwAAAFQAAAAcAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZQXByREAIQgEwP9WmYsjhxgOKJN/CNs9vmdOQ2zdRw2dxQnWjqQ/3oIgXQM9vqUiwkiX8ljWea4ZlCF3xTo1pz6w+wdQSwMEFAAAAAAAxV43TpECY7AqAAAAKgAAACQAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2UNCjUwNDY2N2Y0YzBkZTdhZjFhMDZkZTlmNGIxNzI3Yjg0MzUxZjI5MTBQSwMEFAAAAAAAzF43TpOr0CgqAAAAKgAAABsAAABsaWNlbnNlcy9nb29nbGUtZ2RrLWxpY2Vuc2UNCjMzYjZhMmI2NDYwN2YxMWI3NTlmMzIwZWY5ZGZmNGFlNWM0N2Q5N2FQSwMEFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAABsaWNlbnNlcy9pbnRlbC1hbmRyb2lkLWV4dHJhLWxpY2Vuc2UNCmQ5NzVmNzUxNjk4YTc3YjY2MmYxMjU0ZGRiZWVkMzkwMWU5NzZmNWFQSwMEFAAAAAAA0l43Tu2ee/8qAAAAKgAAACYAAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZQ0KNjNkNzAzZjU2OTJmZDg5MWQ1YWNhY2ZiZDhlMDlmNDBmYzk3NjEwNVBLAQIUABQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAAAAAAAEAIAAAAAAAAABsaWNlbnNlcy9hbmRyb2lkLWdvb2dsZXR2LWxpY2Vuc2VQSwECFAAUAAAACACgazdORPmEqkMAAABUAAAAHAAAAAAAAAABACAAAABpAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZVBLAQIUABQAAAAAAMVeN06RAmOwKgAAACoAAAAkAAAAAAAAAAEAIAAAAOYAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2VQSwECFAAUAAAAAADMXjdOk6vQKCoAAAAqAAAAGwAAAAAAAAABACAAAABSAQAAbGljZW5zZXMvZ29vZ2xlLWdkay1saWNlbnNlUEsBAhQAFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAAAAAAAAAQAgAAAAtQEAAGxpY2Vuc2VzL2ludGVsLWFuZHJvaWQtZXh0cmEtbGljZW5zZVBLAQIUABQAAAAAANJeN07tnnv/KgAAACoAAAAmAAAAAAAAAAEAIAAAACECAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZVBLBQYAAAAABgAGANoBAACPAgAAAAA=" $content = [System.Convert]::FromBase64String($base64Content) Set-Content -Path .\android-sdk-licenses.zip -Value $content -Encoding Byte -Expand-Archive -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' -Force - +Extract-7Zip -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' # run the updates. # keep newer versions in descending order From ec921a2443fde29a19b83d2c264a4e3a2b7eac7d Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 16:19:28 +0300 Subject: [PATCH 31/51] set python3 as default on Ubuntu 20.04 --- images/linux/scripts/installers/python.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/images/linux/scripts/installers/python.sh b/images/linux/scripts/installers/python.sh index 3f6361e16..2cc9c464d 100644 --- a/images/linux/scripts/installers/python.sh +++ b/images/linux/scripts/installers/python.sh @@ -4,21 +4,20 @@ ## Desc: Installs Python 2/3 ################################################################################ +set -e # Source the helpers for use with the script source $HELPER_SCRIPTS/os.sh # Install Python, Python 3, pip, pip3 -if isUbuntu20 ; then - apt-get install -y --no-install-recommends python3 python3-dev python3-pip - - curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py - python2 get-pip.py -fi - if isUbuntu16 || isUbuntu18 ; then apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip fi +if isUbuntu20 ; then + apt-get install -y --no-install-recommends python3 python3-dev python3-pip python-is-python3 + ln -s /usr/bin/pip3 /usr/bin/pip +fi + # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" for cmd in python pip python3 pip3; do From 63a1d3a583c426a4ea7d6fda1b429b4d8d59315a Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 16:59:28 +0300 Subject: [PATCH 32/51] replace python-is-python2 to python-is-python3 --- images/linux/scripts/installers/python.sh | 6 +++--- images/linux/toolsets/toolset-2004.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/python.sh b/images/linux/scripts/installers/python.sh index 2cc9c464d..470417783 100644 --- a/images/linux/scripts/installers/python.sh +++ b/images/linux/scripts/installers/python.sh @@ -9,12 +9,12 @@ set -e source $HELPER_SCRIPTS/os.sh # Install Python, Python 3, pip, pip3 -if isUbuntu16 || isUbuntu18 ; then +if isUbuntu16 || isUbuntu18; then apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip fi -if isUbuntu20 ; then - apt-get install -y --no-install-recommends python3 python3-dev python3-pip python-is-python3 +if isUbuntu20; then + apt-get install -y --no-install-recommends python3 python3-dev python3-pip ln -s /usr/bin/pip3 /usr/bin/pip fi diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index 5ac230255..7c704263b 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -96,7 +96,7 @@ "locales", "openssh-client", "pkg-config", - "python-is-python2", + "python-is-python3", "rpm", "texinfo", "tk", From d66f67dbe1b68097daebdabaa7cbffe8ec252f48 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 18:48:31 +0300 Subject: [PATCH 33/51] fix parsing --- images/win/scripts/Installers/Update-AndroidSDK.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index a18f89ad7..12f7964e3 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -21,7 +21,7 @@ $ErrorActionPreference = "Stop" $base64Content = "UEsDBBQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAbGljZW5zZXMvYW5kcm9pZC1nb29nbGV0di1saWNlbnNlDQpmYzk0NmU4ZjIzMWYzZTMxNTliZjBiN2M2NTVjOTI0Y2IyZTM4MzMwUEsDBBQAAAAIAKBrN05E+YSqQwAAAFQAAAAcAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZQXByREAIQgEwP9WmYsjhxgOKJN/CNs9vmdOQ2zdRw2dxQnWjqQ/3oIgXQM9vqUiwkiX8ljWea4ZlCF3xTo1pz6w+wdQSwMEFAAAAAAAxV43TpECY7AqAAAAKgAAACQAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2UNCjUwNDY2N2Y0YzBkZTdhZjFhMDZkZTlmNGIxNzI3Yjg0MzUxZjI5MTBQSwMEFAAAAAAAzF43TpOr0CgqAAAAKgAAABsAAABsaWNlbnNlcy9nb29nbGUtZ2RrLWxpY2Vuc2UNCjMzYjZhMmI2NDYwN2YxMWI3NTlmMzIwZWY5ZGZmNGFlNWM0N2Q5N2FQSwMEFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAABsaWNlbnNlcy9pbnRlbC1hbmRyb2lkLWV4dHJhLWxpY2Vuc2UNCmQ5NzVmNzUxNjk4YTc3YjY2MmYxMjU0ZGRiZWVkMzkwMWU5NzZmNWFQSwMEFAAAAAAA0l43Tu2ee/8qAAAAKgAAACYAAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZQ0KNjNkNzAzZjU2OTJmZDg5MWQ1YWNhY2ZiZDhlMDlmNDBmYzk3NjEwNVBLAQIUABQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAAAAAAAEAIAAAAAAAAABsaWNlbnNlcy9hbmRyb2lkLWdvb2dsZXR2LWxpY2Vuc2VQSwECFAAUAAAACACgazdORPmEqkMAAABUAAAAHAAAAAAAAAABACAAAABpAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZVBLAQIUABQAAAAAAMVeN06RAmOwKgAAACoAAAAkAAAAAAAAAAEAIAAAAOYAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2VQSwECFAAUAAAAAADMXjdOk6vQKCoAAAAqAAAAGwAAAAAAAAABACAAAABSAQAAbGljZW5zZXMvZ29vZ2xlLWdkay1saWNlbnNlUEsBAhQAFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAAAAAAAAAQAgAAAAtQEAAGxpY2Vuc2VzL2ludGVsLWFuZHJvaWQtZXh0cmEtbGljZW5zZVBLAQIUABQAAAAAANJeN07tnnv/KgAAACoAAAAmAAAAAAAAAAEAIAAAACECAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZVBLBQYAAAAABgAGANoBAACPAgAAAAA=" $content = [System.Convert]::FromBase64String($base64Content) Set-Content -Path .\android-sdk-licenses.zip -Value $content -Encoding Byte -Extract-7Zip -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' +Expand-Archive -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' -Force # run the updates. # keep newer versions in descending order @@ -39,12 +39,12 @@ $androidPackages = & $sdkManager --list --verbose # platforms [int]$platformMinVersion = $androidToolset.platform_min_version -$platformList = $androidPackages | Where-Object { "$_".StartsWith("platforms;") } | +$platformList = $androidPackages.Trim() | Where-Object { "$_".StartsWith("platforms;") } | Foreach-Object { $_.Split()[0] } | Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique # build-tools [version]$buildToolsMinVersion = $androidToolset.build_tools_min_version -$buildToolsList = $androidPackages | Where-Object { "$_".StartsWith("build-tools;") } | +$buildToolsList = $androidPackages.Trim() | Where-Object { "$_".StartsWith("build-tools;") } | Foreach-Object { $_.Split()[0] } | Where-Object { [version]$_.Split(";")[1] -ge $buildToolsMinVersion } | Sort-Object { [version]$_.Split(";")[1] } -Unique Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` From 56633cec4a6ad6c1eb0e4755e8d47b7c4eda31b2 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Wed, 30 Sep 2020 20:13:40 +0300 Subject: [PATCH 34/51] refactor and rename scripts --- ...trySettings.ps1 => AzureRegistrySettings.ps1} | 0 .../{Update-DotnetPath.ps1 => DotnetPath.ps1} | 12 +----------- images/win/post-generation/MercurialPath.ps1 | 8 ++++++++ ...{Create-RustJunction.ps1 => RustJunction.ps1} | 0 .../{Add-SshHostKeys.ps1 => SshHostKeys.ps1} | 0 .../win/post-generation/Update-MercurialPath.ps1 | 16 ---------------- ...e-VSConfiguration.ps1 => VSConfiguration.ps1} | 0 7 files changed, 9 insertions(+), 27 deletions(-) rename images/win/post-generation/{Remove-AzureRegistrySettings.ps1 => AzureRegistrySettings.ps1} (100%) rename images/win/post-generation/{Update-DotnetPath.ps1 => DotnetPath.ps1} (55%) create mode 100644 images/win/post-generation/MercurialPath.ps1 rename images/win/post-generation/{Create-RustJunction.ps1 => RustJunction.ps1} (100%) rename images/win/post-generation/{Add-SshHostKeys.ps1 => SshHostKeys.ps1} (100%) delete mode 100644 images/win/post-generation/Update-MercurialPath.ps1 rename images/win/post-generation/{Update-VSConfiguration.ps1 => VSConfiguration.ps1} (100%) diff --git a/images/win/post-generation/Remove-AzureRegistrySettings.ps1 b/images/win/post-generation/AzureRegistrySettings.ps1 similarity index 100% rename from images/win/post-generation/Remove-AzureRegistrySettings.ps1 rename to images/win/post-generation/AzureRegistrySettings.ps1 diff --git a/images/win/post-generation/Update-DotnetPath.ps1 b/images/win/post-generation/DotnetPath.ps1 similarity index 55% rename from images/win/post-generation/Update-DotnetPath.ps1 rename to images/win/post-generation/DotnetPath.ps1 index c051ebd4a..ea5a2de5a 100644 --- a/images/win/post-generation/Update-DotnetPath.ps1 +++ b/images/win/post-generation/DotnetPath.ps1 @@ -4,19 +4,9 @@ $dotnetPath = "$env:USERPROFILE\.dotnet\tools" if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) { $latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath") - $isPathUpdated = $true } if (-not $latestPath.Contains($dotnetPath)) { $latestPath = "$dotnetPath;$latestPath" - Write-Host "Added .dotnet\tools $dotnetPath to PATH" - $isPathUpdated = $true -} -else -{ - Write-Host "$dotnetPath already in PATH" -} - -$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) -Write-Host "Windows PATH: $updatedPath" \ No newline at end of file +} \ No newline at end of file diff --git a/images/win/post-generation/MercurialPath.ps1 b/images/win/post-generation/MercurialPath.ps1 new file mode 100644 index 000000000..7847d7142 --- /dev/null +++ b/images/win/post-generation/MercurialPath.ps1 @@ -0,0 +1,8 @@ +$hgPath = "$Env:ProgramFiles\Mercurial\" +$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) + +if (Test-Path -Path $hgPath) +{ + $latestPath = "$hgPath;$latestPath" + Write-Host "Added Mercurial to PATH" +} diff --git a/images/win/post-generation/Create-RustJunction.ps1 b/images/win/post-generation/RustJunction.ps1 similarity index 100% rename from images/win/post-generation/Create-RustJunction.ps1 rename to images/win/post-generation/RustJunction.ps1 diff --git a/images/win/post-generation/Add-SshHostKeys.ps1 b/images/win/post-generation/SshHostKeys.ps1 similarity index 100% rename from images/win/post-generation/Add-SshHostKeys.ps1 rename to images/win/post-generation/SshHostKeys.ps1 diff --git a/images/win/post-generation/Update-MercurialPath.ps1 b/images/win/post-generation/Update-MercurialPath.ps1 deleted file mode 100644 index de68e1812..000000000 --- a/images/win/post-generation/Update-MercurialPath.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$hgPath = "$Env:ProgramFiles\Mercurial\" -$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) - -if (Test-Path -Path $hgPath) -{ - $latestPath = "$hgPath;$latestPath" - Write-Host "Added Mercurial to PATH" - $isPathUpdated = $true -} -else -{ - Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it." -} - -$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) -Write-Host "Windows PATH: $updatedPath" \ No newline at end of file diff --git a/images/win/post-generation/Update-VSConfiguration.ps1 b/images/win/post-generation/VSConfiguration.ps1 similarity index 100% rename from images/win/post-generation/Update-VSConfiguration.ps1 rename to images/win/post-generation/VSConfiguration.ps1 From c50e6e62b5e90f70febf08824407cea85a99bc02 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 23:42:32 +0300 Subject: [PATCH 35/51] use helper functions --- .../scripts/ImageHelpers/ImageHelpers.psm1 | 3 ++ .../scripts/ImageHelpers/InstallHelpers.ps1 | 38 +++++++++++++++++++ .../scripts/Installers/Update-AndroidSDK.ps1 | 16 +++++--- .../SoftwareReport.Android.psm1 | 6 --- images/win/scripts/Tests/Android.Tests.ps1 | 16 +++++--- 5 files changed, 63 insertions(+), 16 deletions(-) diff --git a/images/win/scripts/ImageHelpers/ImageHelpers.psm1 b/images/win/scripts/ImageHelpers/ImageHelpers.psm1 index e150e1a12..1f52d22e6 100644 --- a/images/win/scripts/ImageHelpers/ImageHelpers.psm1 +++ b/images/win/scripts/ImageHelpers/ImageHelpers.psm1 @@ -37,6 +37,9 @@ Export-ModuleMember -Function @( 'Get-VsCatalogJsonPath' 'Get-VisualStudioPath' 'Install-AndroidSDKPackages' + 'Get-AndroidPackages' + 'Get-AndroidPackagesByName' + 'Get-AndroidPackagesByVersion' 'Get-VisualStudioPackages' 'Get-VisualStudioComponents' ) diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index 282c03762..e62354f03 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -418,3 +418,41 @@ function Install-AndroidSDKPackages { & $AndroidSDKManagerPath --sdk_root=$AndroidSDKRootPath "$PrefixPackageName$package" } } + +function Get-AndroidPackages { + Param + ( + [Parameter(Mandatory=$true)] + [string]$AndroidSDKManagerPath + ) + + return (& $AndroidSDKManagerPath --list --verbose).Trim() | Foreach-Object { $_.Split()[0] } | Where-Object {$_} +} + +function Get-AndroidPackagesByName { + Param ( + [Parameter(Mandatory=$true)] + [string[]]$AndroidPackages, + [Parameter(Mandatory=$true)] + [string]$PrefixPackageName + ) + + return $AndroidPackages | Where-Object { "$_".StartsWith($PrefixPackageName) } +} + +function Get-AndroidPackagesByVersion { + Param ( + [Parameter(Mandatory=$true)] + [string[]]$AndroidPackages, + [Parameter(Mandatory=$true)] + [string]$PrefixPackageName, + [object]$MinimumVersion, + [char]$Delimeter, + [int]$Index = 0 + ) + + $Type = $MinimumVersion.GetType() + $packagesByName = Get-AndroidPackagesByName -AndroidPackages $AndroidPackages -PrefixPackageName $PrefixPackageName + $packagesByVersion = $packagesByName | Where-Object { ($_.Split($Delimeter)[$Index] -as $Type) -ge $MinimumVersion } + return $packagesByVersion | Sort-Object { $_.Split($Delimeter)[$Index] -as $Type} -Unique +} diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index 12f7964e3..983d25ce6 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -35,17 +35,23 @@ $sdkManager = "$sdkRoot\tools\bin\sdkmanager.bat" & $sdkManager --sdk_root=$sdkRoot "platform-tools" # get packages info -$androidPackages = & $sdkManager --list --verbose +$androidPackages = Get-AndroidPackages -AndroidSDKManagerPath $sdkManager # platforms [int]$platformMinVersion = $androidToolset.platform_min_version -$platformList = $androidPackages.Trim() | Where-Object { "$_".StartsWith("platforms;") } | Foreach-Object { $_.Split()[0] } | - Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique +$platformList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` + -PrefixPackageName "platforms;" ` + -MinimumVersion $platformMinVersion ` + -Delimeter "-" ` + -Index 1 # build-tools [version]$buildToolsMinVersion = $androidToolset.build_tools_min_version -$buildToolsList = $androidPackages.Trim() | Where-Object { "$_".StartsWith("build-tools;") } | Foreach-Object { $_.Split()[0] } | - Where-Object { [version]$_.Split(";")[1] -ge $buildToolsMinVersion } | Sort-Object { [version]$_.Split(";")[1] } -Unique +$buildToolsList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` + -PrefixPackageName "build-tools;" ` + -MinimumVersion $buildToolsMinVersion ` + -Delimeter ";" ` + -Index 1 Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` -AndroidSDKRootPath $sdkRoot ` diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 index dd59f77f4..d3c9a1743 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Android.psm1 @@ -31,12 +31,6 @@ function Get-AndroidInstalledPackages { return $androidInstalledPackages } -function Get-AndroidPackages { - $androidSDKManagerPath = Get-AndroidSDKManagerPath - $androidPackages = & $androidSDKManagerPath --list --verbose - return $androidPackages -} - function Build-AndroidTable { $packageInfo = Get-AndroidInstalledPackages return @( diff --git a/images/win/scripts/Tests/Android.Tests.ps1 b/images/win/scripts/Tests/Android.Tests.ps1 index e90ad6828..16baeff45 100644 --- a/images/win/scripts/Tests/Android.Tests.ps1 +++ b/images/win/scripts/Tests/Android.Tests.ps1 @@ -2,21 +2,27 @@ Import-Module (Join-Path $PSScriptRoot "..\SoftwareReport\SoftwareReport.Android Describe "Android SDK" { $androidToolset = (Get-ToolsetContent).android - $androidPackages = Get-AndroidPackages + $androidPackages = Get-AndroidPackages -AndroidSDKManagerPath (Get-AndroidSDKManagerPath) $androidInstalledPackages = Get-AndroidInstalledPackages $platformTestCases = @() [int]$platformMinVersion = $androidToolset.platform_min_version - $platformList = $androidPackages | Where-Object { "$_".StartsWith("platforms;") } | - Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique + $platformList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` + -PrefixPackageName "platforms;" ` + -MinimumVersion $platformMinVersion ` + -Delimeter "-" ` + -Index 1 $platformList | ForEach-Object { $platformTestCases += @{ platformVersion = $_; installedPackages = $androidInstalledPackages } } $buildToolsTestCases = @() [version]$buildToolsMinVersion = $androidToolset.build_tools_min_version - $buildToolsList = $androidPackages | Where-Object { "$_".StartsWith("build-tools;") } | - Where-Object { [version]$_.Split(";")[1] -ge $buildToolsMinVersion } | Sort-Object { [version]$_.Split(";")[1] } -Unique + $buildToolsList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` + -PrefixPackageName "build-tools;" ` + -MinimumVersion $buildToolsMinVersion ` + -Delimeter ";" ` + -Index 1 $buildToolsList | ForEach-Object { $buildToolsTestCases += @{ buildToolsVersion = $_; installedPackages = $androidInstalledPackages } } From 5524108024ef201d9207965a73c062c0146a769c Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Wed, 30 Sep 2020 23:47:14 +0300 Subject: [PATCH 36/51] fix typo --- images/win/scripts/ImageHelpers/InstallHelpers.ps1 | 6 +++--- images/win/scripts/Installers/Update-AndroidSDK.ps1 | 4 ++-- images/win/scripts/Tests/Android.Tests.ps1 | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index e62354f03..aed13b999 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -447,12 +447,12 @@ function Get-AndroidPackagesByVersion { [Parameter(Mandatory=$true)] [string]$PrefixPackageName, [object]$MinimumVersion, - [char]$Delimeter, + [char]$Delimiter, [int]$Index = 0 ) $Type = $MinimumVersion.GetType() $packagesByName = Get-AndroidPackagesByName -AndroidPackages $AndroidPackages -PrefixPackageName $PrefixPackageName - $packagesByVersion = $packagesByName | Where-Object { ($_.Split($Delimeter)[$Index] -as $Type) -ge $MinimumVersion } - return $packagesByVersion | Sort-Object { $_.Split($Delimeter)[$Index] -as $Type} -Unique + $packagesByVersion = $packagesByName | Where-Object { ($_.Split($Delimiter)[$Index] -as $Type) -ge $MinimumVersion } + return $packagesByVersion | Sort-Object { $_.Split($Delimiter)[$Index] -as $Type} -Unique } diff --git a/images/win/scripts/Installers/Update-AndroidSDK.ps1 b/images/win/scripts/Installers/Update-AndroidSDK.ps1 index 983d25ce6..c27a4c18c 100644 --- a/images/win/scripts/Installers/Update-AndroidSDK.ps1 +++ b/images/win/scripts/Installers/Update-AndroidSDK.ps1 @@ -42,7 +42,7 @@ $androidPackages = Get-AndroidPackages -AndroidSDKManagerPath $sdkManager $platformList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` -PrefixPackageName "platforms;" ` -MinimumVersion $platformMinVersion ` - -Delimeter "-" ` + -Delimiter "-" ` -Index 1 # build-tools @@ -50,7 +50,7 @@ $platformList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` $buildToolsList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` -PrefixPackageName "build-tools;" ` -MinimumVersion $buildToolsMinVersion ` - -Delimeter ";" ` + -Delimiter ";" ` -Index 1 Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager ` diff --git a/images/win/scripts/Tests/Android.Tests.ps1 b/images/win/scripts/Tests/Android.Tests.ps1 index 16baeff45..d6c81db4a 100644 --- a/images/win/scripts/Tests/Android.Tests.ps1 +++ b/images/win/scripts/Tests/Android.Tests.ps1 @@ -10,7 +10,7 @@ Describe "Android SDK" { $platformList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` -PrefixPackageName "platforms;" ` -MinimumVersion $platformMinVersion ` - -Delimeter "-" ` + -Delimiter "-" ` -Index 1 $platformList | ForEach-Object { $platformTestCases += @{ platformVersion = $_; installedPackages = $androidInstalledPackages } @@ -21,7 +21,7 @@ Describe "Android SDK" { $buildToolsList = Get-AndroidPackagesByVersion -AndroidPackages $androidPackages ` -PrefixPackageName "build-tools;" ` -MinimumVersion $buildToolsMinVersion ` - -Delimeter ";" ` + -Delimiter ";" ` -Index 1 $buildToolsList | ForEach-Object { $buildToolsTestCases += @{ buildToolsVersion = $_; installedPackages = $androidInstalledPackages } From 91ee0cc2682fcc58b746667164239c906c9293a7 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 10:48:50 +0300 Subject: [PATCH 37/51] rename and remove scripts --- images/win/post-generation/AzureRegistrySettings.ps1 | 7 ------- images/win/post-generation/{DotnetPath.ps1 => Dotnet.ps1} | 0 images/win/post-generation/MercurialPath.ps1 | 8 -------- 3 files changed, 15 deletions(-) delete mode 100644 images/win/post-generation/AzureRegistrySettings.ps1 rename images/win/post-generation/{DotnetPath.ps1 => Dotnet.ps1} (100%) delete mode 100644 images/win/post-generation/MercurialPath.ps1 diff --git a/images/win/post-generation/AzureRegistrySettings.ps1 b/images/win/post-generation/AzureRegistrySettings.ps1 deleted file mode 100644 index e3a62d372..000000000 --- a/images/win/post-generation/AzureRegistrySettings.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -$ErrorActionPreference="Stop" - -# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a -# race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines. -Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore -Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore -Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore diff --git a/images/win/post-generation/DotnetPath.ps1 b/images/win/post-generation/Dotnet.ps1 similarity index 100% rename from images/win/post-generation/DotnetPath.ps1 rename to images/win/post-generation/Dotnet.ps1 diff --git a/images/win/post-generation/MercurialPath.ps1 b/images/win/post-generation/MercurialPath.ps1 deleted file mode 100644 index 7847d7142..000000000 --- a/images/win/post-generation/MercurialPath.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -$hgPath = "$Env:ProgramFiles\Mercurial\" -$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) - -if (Test-Path -Path $hgPath) -{ - $latestPath = "$hgPath;$latestPath" - Write-Host "Added Mercurial to PATH" -} From c101287fd83cc310e38f6d19d3a9547324882373 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 11:41:42 +0300 Subject: [PATCH 38/51] rework dotnet script --- images/win/post-generation/Dotnet.ps1 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/images/win/post-generation/Dotnet.ps1 b/images/win/post-generation/Dotnet.ps1 index ea5a2de5a..5f38eaec8 100644 --- a/images/win/post-generation/Dotnet.ps1 +++ b/images/win/post-generation/Dotnet.ps1 @@ -1,12 +1,9 @@ $latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) - $dotnetPath = "$env:USERPROFILE\.dotnet\tools" -if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) -{ - $latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath") -} if (-not $latestPath.Contains($dotnetPath)) { $latestPath = "$dotnetPath;$latestPath" -} \ No newline at end of file +} + +[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) \ No newline at end of file From fb82e1197aef8a52f10d3762019f4b46d2213449 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 11:52:39 +0300 Subject: [PATCH 39/51] add scripts to templates --- images/win/Windows2016-Azure.json | 5 +++++ images/win/Windows2019-Azure.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 77d57aef1..4c8111bed 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -82,6 +82,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/post-generation", + "destination": "{{user `image_folder`}}" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 473051dba..fe47bd64e 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -82,6 +82,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/post-generation", + "destination": "{{user `image_folder`}}" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", From 3a2c8bc0b966a5ea6a4c2982118e2acdac9422eb Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 12:28:33 +0300 Subject: [PATCH 40/51] change destination --- images/win/Windows2016-Azure.json | 2 +- images/win/Windows2019-Azure.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 4c8111bed..a0edde4bc 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -85,7 +85,7 @@ { "type": "file", "source": "{{ template_dir }}/post-generation", - "destination": "{{user `image_folder`}}" + "destination": "C:/post-generation" }, { "type": "file", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index fe47bd64e..6f0759e18 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -85,7 +85,7 @@ { "type": "file", "source": "{{ template_dir }}/post-generation", - "destination": "{{user `image_folder`}}" + "destination": "C:/post-generation" }, { "type": "file", From 29300ce6eb3db1b5071d8c1f51b84c0ab18bbe9e Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 12:43:21 +0300 Subject: [PATCH 41/51] minor change --- images/win/post-generation/Dotnet.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/images/win/post-generation/Dotnet.ps1 b/images/win/post-generation/Dotnet.ps1 index 5f38eaec8..fd43757a6 100644 --- a/images/win/post-generation/Dotnet.ps1 +++ b/images/win/post-generation/Dotnet.ps1 @@ -4,6 +4,5 @@ $dotnetPath = "$env:USERPROFILE\.dotnet\tools" if (-not $latestPath.Contains($dotnetPath)) { $latestPath = "$dotnetPath;$latestPath" -} - -[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) \ No newline at end of file + [System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) +} \ No newline at end of file From 46da19770f66ae2888126777bef72227b55a7870 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Thu, 1 Oct 2020 12:53:28 +0300 Subject: [PATCH 42/51] fix directory name --- images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index d1984b2ac..915f857fd 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -29,7 +29,7 @@ function Get-BazeliskVersion { } function Get-CodeQLBundleVersion { - $CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*" + $CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*" $CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName $CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql" $CodeQLVersion = & $CodeQLPath version --quiet From da68de0a0932dbaf6f7cac642d38a68af2e66618 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Thu, 1 Oct 2020 13:11:30 +0300 Subject: [PATCH 43/51] Implement logic to check if xcode is beta --- images/macos/helpers/Xcode.Helpers.psm1 | 10 +++++++++- images/macos/software-report/SoftwareReport.Xcode.psm1 | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/images/macos/helpers/Xcode.Helpers.psm1 b/images/macos/helpers/Xcode.Helpers.psm1 index dbc4803c2..c4a5ca70e 100644 --- a/images/macos/helpers/Xcode.Helpers.psm1 +++ b/images/macos/helpers/Xcode.Helpers.psm1 @@ -45,6 +45,14 @@ function Switch-Xcode { Invoke-Expression "sudo xcode-select --switch ${XcodeRootPath}" } +function Test-XcodeStableRelease { + param([string] $XcodeRootPath) + + $licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist" + $releaseType = & defaults read $licenseInfoPlistPath "licenseType" + return -not ($releaseType -match "beta") +} + function Get-XcodeSimulatorsInfo { param( [string] $Filter @@ -102,6 +110,6 @@ function Test-XcodeStableVersion { if ($Version -match "GM") { return $false } - + return $true } \ No newline at end of file diff --git a/images/macos/software-report/SoftwareReport.Xcode.psm1 b/images/macos/software-report/SoftwareReport.Xcode.psm1 index 59754d583..3d4cfa52d 100644 --- a/images/macos/software-report/SoftwareReport.Xcode.psm1 +++ b/images/macos/software-report/SoftwareReport.Xcode.psm1 @@ -46,7 +46,8 @@ function Get-XcodeInfoList { $versionInfo = Get-XcodeVersionInfo $versionInfo.Path = $xcodeRootPath $versionInfo.IsDefault = ($xcodeRootPath -eq $defaultXcodeRootPath) - + $versionInfo.IsStable = Test-XcodeStableRelease -XcodeRootPath $xcodeRootPath + $xcodeInfo.Add($xcodeRootPath, [PSCustomObject] @{ VersionInfo = $versionInfo SDKInfo = Get-XcodeSDKList @@ -91,6 +92,7 @@ function Build-XcodeTable { $xcodeList = $xcodeInfo.Values | ForEach-Object { $_.VersionInfo } | Sort-Object $sortRules return $xcodeList | ForEach-Object { $defaultPostfix = If ($_.IsDefault) { " (default)" } else { "" } + $betaPostfix = If ($_.IsStable) { "" } else { " (beta)" } return [PSCustomObject] @{ "Version" = $_.Version.ToString() + $betaPostfix + $defaultPostfix "Build" = $_.Build From 1cce301a9289883bca75ea025bde5873fafc5621 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 1 Oct 2020 14:48:15 +0300 Subject: [PATCH 44/51] set 6_12_0 as default bundle --- images/macos/toolsets/toolset-10.15.json | 10 +++++----- images/macos/toolsets/toolset-11.0.json | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index 8497a7100..f834385c2 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -19,35 +19,35 @@ "android-versions": [ "11.0.2.0", "10.3.1.4", "10.2.0.100", "10.1.3.7", "10.0.6.2" ], - "bundle-default": "latest", + "bundle-default": "6_12_0", "bundles": [ { "symlink": "6_12_1", "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", diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index 725da2188..f4e9a57c8 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -19,21 +19,21 @@ "android-versions": [ "11.0.2.0" ], - "bundle-default": "latest", + "bundle-default": "6_12_0", "bundles": [ { "symlink": "6_12_1", "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" } ] }, From ed9705b7fd2ccb8870b8f613910c08d437d29d70 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 14:53:27 +0300 Subject: [PATCH 45/51] move ssh host key creation to install-git.ps1 --- images/win/post-generation/SshHostKeys.ps1 | 4 ---- images/win/scripts/Installers/Install-Git.ps1 | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 images/win/post-generation/SshHostKeys.ps1 diff --git a/images/win/post-generation/SshHostKeys.ps1 b/images/win/post-generation/SshHostKeys.ps1 deleted file mode 100644 index 114a98d6a..000000000 --- a/images/win/post-generation/SshHostKeys.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -# 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" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index 2a5ea9259..16b7ac15e 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -40,5 +40,10 @@ Choco-Install -PackageName hub Add-MachinePathItem "C:\Program Files\Git\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" From 3e94ae478bf1e41639a6cf8fb369862917796045 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 1 Oct 2020 21:56:41 +0300 Subject: [PATCH 46/51] remove grants to audiodevices --- images/macos/provision/core/audiodevice.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/images/macos/provision/core/audiodevice.sh b/images/macos/provision/core/audiodevice.sh index 705490de2..4a151e3f9 100644 --- a/images/macos/provision/core/audiodevice.sh +++ b/images/macos/provision/core/audiodevice.sh @@ -12,8 +12,3 @@ brew install sox echo "set Soundflower (2ch) as input/output device" SwitchAudioSource -s "Soundflower (2ch)" -t input SwitchAudioSource -s "Soundflower (2ch)" -t output - -echo "grant microphone permission for simulators" -sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values('kTCCServiceMicrophone','com.apple.CoreSimulator.SimulatorTrampoline', 0,1,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,1576347152)" -sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values('kTCCServiceMicrophone','/usr/local/opt/runner/runprovisioner.sh', 1,1,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,1576661342)" -sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values('kTCCServiceMicrophone','/usr/local/opt/runner/runprovisioner.sh', 1,1,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,1576661342)" From fc8383a81ea4c0b8a65e530c5195af7f111ff8e2 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Fri, 2 Oct 2020 08:05:11 +0300 Subject: [PATCH 47/51] Update Xcode.Helpers.psm1 --- images/macos/helpers/Xcode.Helpers.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/macos/helpers/Xcode.Helpers.psm1 b/images/macos/helpers/Xcode.Helpers.psm1 index c4a5ca70e..8ea137e63 100644 --- a/images/macos/helpers/Xcode.Helpers.psm1 +++ b/images/macos/helpers/Xcode.Helpers.psm1 @@ -46,7 +46,10 @@ function Switch-Xcode { } function Test-XcodeStableRelease { - param([string] $XcodeRootPath) + param( + [Parameter(Mandatory)] + [string] $XcodeRootPath + ) $licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist" $releaseType = & defaults read $licenseInfoPlistPath "licenseType" From f8c071db4ada61cff9eae1ceb73b622d5d1be5ce Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 2 Oct 2020 09:20:15 +0300 Subject: [PATCH 48/51] fix simulators section --- .../software-report/SoftwareReport.Generator.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 87c944598..0ef53471e 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -289,6 +289,8 @@ $markdown += New-MDList -Lines (Build-XamarinAndroidList) -Style Unordered $markdown += New-MDHeader "Unit Test Framework" -Level 4 $markdown += New-MDList -Lines @(Get-NUnitVersion) -Style Unordered +# First run doesn't provide full data about devices and runtimes +Get-XcodeInfoList | Out-Null # Xcode section $xcodeInfo = Get-XcodeInfoList $markdown += New-MDHeader "Xcode" -Level 3 @@ -301,12 +303,9 @@ $markdown += New-MDHeader "Installed SDKs" -Level 4 $markdown += Build-XcodeSDKTable $xcodeInfo | New-MDTable $markdown += New-MDNewLine -# Disable simulators table on 11.0 beta for now since "simctl" tool doesn't work properly -if (-not $os.IsBigSur) { - $markdown += New-MDHeader "Installed Simulators" -Level 4 - $markdown += Build-XcodeSimulatorsTable $xcodeInfo | New-MDTable - $markdown += New-MDNewLine -} +$markdown += New-MDHeader "Installed Simulators" -Level 4 +$markdown += Build-XcodeSimulatorsTable $xcodeInfo | New-MDTable +$markdown += New-MDNewLine # Android section $markdown += New-MDHeader "Android" -Level 3 From 1b736c25b10a4cd72a08aa1f695b0e3bb9a85598 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2020 06:22:28 +0000 Subject: [PATCH 49/51] Updating readme file for macos-10.15 version 20200918.1 (#1639) Co-authored-by: no-reply@microsoft.com Co-authored-by: Actions service account --- images/macos/macos-10.15-Readme.md | 53 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/images/macos/macos-10.15-Readme.md b/images/macos/macos-10.15-Readme.md index 26492d8e6..af4024fc6 100644 --- a/images/macos/macos-10.15-Readme.md +++ b/images/macos/macos-10.15-Readme.md @@ -1,15 +1,15 @@ # macOS 10.15 info - System Version: macOS 10.15.6 (19G2021) - Kernel Version: Darwin 19.6.0 -- Image Version: 20200916.1 +- Image Version: 20200918.1 ## Installed Software ### Language and Runtime - Clang/LLVM 10.0.1 -- gcc-8 (Homebrew GCC 8.4.0_1) 8.4.0 — available by `gcc-8` alias -- gcc-9 (Homebrew GCC 9.3.0) 9.3.0 — available by `gcc-9` alias -- GNU Fortran (Homebrew GCC 8.4.0_1) 8.4.0 — available by `gfortran-8` alias -- GNU Fortran (Homebrew GCC 9.3.0) 9.3.0 — available by `gfortran-9` alias +- gcc-8 (Homebrew GCC 8.4.0_1) 8.4.0 - available by `gcc-8` alias +- gcc-9 (Homebrew GCC 9.3.0) 9.3.0 - available by `gcc-9` alias +- GNU Fortran (Homebrew GCC 8.4.0_1) 8.4.0 - available by `gfortran-8` alias +- GNU Fortran (Homebrew GCC 9.3.0) 9.3.0 - available by `gfortran-9` alias - Node.js v12.18.3 - NVM 0.35.3 - NVM - Cached node versions: v6.17.1 v8.17.0 v10.22.1 v12.18.4 v13.14.0 v14.11.0 @@ -24,15 +24,15 @@ ### Package Management - Vcpkg 2020.06.15 +- Pip 19.3.1 (python 2.7) +- Pip 20.1.1 (python 3.8) - Bundler version 2.1.4 -- Carthage 0.35.0 +- Carthage 0.36.0 - CocoaPods 1.9.3 - Homebrew 2.5.1 - NPM 6.14.6 - Yarn 1.22.5 - NuGet 5.6.0.6489 -- Pip 19.3.1 (python 2.7) -- Pip 20.1.1 (python 3.8) - Miniconda 4.8.3 - RubyGems 3.1.4 - Composer 1.10.13 @@ -46,12 +46,11 @@ - Curl 7.72.0 - Git: 2.28.0 - Git LFS: 2.12.0 -- GitHub CLI: 0.12.0 +- GitHub CLI: 1.0.0 - Hub CLI: 2.14.2 - GNU Wget 1.20.3 - Subversion (SVN) 1.14.0 - Packer 1.6.2 -- GNU parallel 20200722 - OpenSSL 1.0.2t 10 Sep 2019 `(/usr/local/opt/openssl -> /usr/local/Cellar/openssl@1.0.2t/1.0.2t)` - jq 1.6 - gpg (GnuPG) 2.2.23 @@ -62,24 +61,25 @@ - zstd 1.4.5 - bazel 3.5.0 - bazelisk 1.6.1 -- helm v3.3.1+g249e521 +- helm v3.3.2+ge507725 - virtualbox 6.1.14r140239 - mongo v4.4.0 - mongod v4.4.0 - Vagrant 2.2.10 - 7-Zip 16.02 - Newman 5.2.0 +- GNU parallel 20200722 ### Tools -- Fastlane 2.159.0 +- Fastlane 2.160.0 - Cmake 3.18.2 - App Center CLI 2.7.0 - Azure CLI 2.11.1 - AWS CLI 2.0.48 - AWS SAM CLI 1.2.0 - AWS Session Manager CLI 1.1.61.0 -- Aliyun CLI 3.0.56 +- Aliyun CLI 3.0.58 - GHCup v0.1.10 - GHC 8.10.2 - Cabal 3.2.0.0 @@ -90,8 +90,8 @@ - SwiftLint 0.40.2 ### Browsers -- Safari 13.1.2 (15609.3.5.1.3) -- SafariDriver 13.1.2 (15609.3.5.1.3) +- Safari 14.0 (15610.1.28.1.9) +- SafariDriver 14.0 (15610.1.28.1.9) - Google Chrome 85.0.4183.102 - ChromeDriver 85.0.4183.87 - Microsoft Edge 85.0.564.51 @@ -161,7 +161,7 @@ ### Xamarin #### Visual Studio for Mac -- 8.7.5.19 +- 8.7.7.10 #### Mono - 6.12.0.93 @@ -205,6 +205,7 @@ ### Xcode | Version | Build | Path | | -------------- | -------- | ------------------------------- | +| 12.2 | 12B5018i | /Applications/Xcode_12.2.app | | 12.0 | 12A8189n | /Applications/Xcode_12_beta.app | | 12.0 | 12A7209 | /Applications/Xcode_12.app | | 11.7 (default) | 11E801a | /Applications/Xcode_11.7.app | @@ -219,18 +220,18 @@ | 10.3 | 10G8 | /Applications/Xcode_10.3.app | #### Xcode Support Tools +- xcpretty 0.3.0 +- xcversion 2.6.6 - Nomad CLI 3.1.4 - Nomad CLI IPA ipa 0.14.3 -- xcpretty 0.3.0 - xctool 0.3.7 -- xcversion 2.6.6 #### Installed SDKs | SDK | SDK Name | Xcode Version | | ----------------------- | -------------------- | ---------------------------------------------------------------- | | macOS 10.14 | macosx10.14 | 10.3 | | macOS 10.15 | macosx10.15 | 11.0, 11.1, 11.2.1, 11.3.1, 11.4, 11.4.1, 11.5, 11.6, 11.7, 12.0 | -| macOS 11.0 | macosx11.0 | 12.0 | +| macOS 11.0 | macosx11.0 | 12.0, 12.2 | | iOS 12.4 | iphoneos12.4 | 10.3 | | iOS 13.0 | iphoneos13.0 | 11.0 | | iOS 13.1 | iphoneos13.1 | 11.1 | @@ -240,6 +241,7 @@ | iOS 13.6 | iphoneos13.6 | 11.6 | | iOS 13.7 | iphoneos13.7 | 11.7 | | iOS 14.0 | iphoneos14.0 | 12.0, 12.0 | +| iOS 14.2 | iphoneos14.2 | 12.2 | | Simulator - iOS 12.4 | iphonesimulator12.4 | 10.3 | | Simulator - iOS 13.0 | iphonesimulator13.0 | 11.0 | | Simulator - iOS 13.1 | iphonesimulator13.1 | 11.1 | @@ -249,28 +251,33 @@ | Simulator - iOS 13.6 | iphonesimulator13.6 | 11.6 | | Simulator - iOS 13.7 | iphonesimulator13.7 | 11.7 | | Simulator - iOS 14.0 | iphonesimulator14.0 | 12.0, 12.0 | +| Simulator - iOS 14.2 | iphonesimulator14.2 | 12.2 | | tvOS 12.4 | appletvos12.4 | 10.3 | | tvOS 13.0 | appletvos13.0 | 11.0, 11.1 | | tvOS 13.2 | appletvos13.2 | 11.2.1, 11.3.1 | | tvOS 13.4 | appletvos13.4 | 11.4, 11.4.1, 11.5, 11.6, 11.7 | | tvOS 14.0 | appletvos14.0 | 12.0, 12.0 | +| tvOS 14.2 | appletvos14.2 | 12.2 | | Simulator - tvOS 12.4 | appletvsimulator12.4 | 10.3 | | Simulator - tvOS 13.0 | appletvsimulator13.0 | 11.0, 11.1 | | Simulator - tvOS 13.2 | appletvsimulator13.2 | 11.2.1, 11.3.1 | | Simulator - tvOS 13.4 | appletvsimulator13.4 | 11.4, 11.4.1, 11.5, 11.6, 11.7 | | Simulator - tvOS 14.0 | appletvsimulator14.0 | 12.0, 12.0 | +| Simulator - tvOS 14.2 | appletvsimulator14.2 | 12.2 | | watchOS 5.3 | watchos5.3 | 10.3 | | watchOS 6.0 | watchos6.0 | 11.0, 11.1 | | watchOS 6.1 | watchos6.1 | 11.2.1, 11.3.1 | | watchOS 6.2 | watchos6.2 | 11.4, 11.4.1, 11.5, 11.6, 11.7 | | watchOS 7.0 | watchos7.0 | 12.0, 12.0 | +| watchOS 7.1 | watchos7.1 | 12.2 | | Simulator - watchOS 5.3 | watchsimulator5.3 | 10.3 | | Simulator - watchOS 6.0 | watchsimulator6.0 | 11.0, 11.1 | | Simulator - watchOS 6.1 | watchsimulator6.1 | 11.2.1, 11.3.1 | | Simulator - watchOS 6.2 | watchsimulator6.2 | 11.4, 11.4.1, 11.5, 11.6, 11.7 | | Simulator - watchOS 7.0 | watchsimulator7.0 | 12.0, 12.0 | +| Simulator - watchOS 7.1 | watchsimulator7.1 | 12.2 | | DriverKit 19.0 | driverkit.macosx19.0 | 11.0, 11.1, 11.2.1, 11.3.1, 11.4, 11.4.1, 11.5, 11.6, 11.7, 12.0 | -| DriverKit 20.0 | driverkit.macosx20.0 | 12.0 | +| DriverKit 20.0 | driverkit.macosx20.0 | 12.0, 12.2 | #### Installed Simulators | OS | Xcode Version | Simulators | @@ -284,18 +291,18 @@ | iOS 13.5 | 11.5 | iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 8
iPhone 8 Plus
iPhone SE (2nd generation)
iPad (7th generation)
iPad Air (3rd generation)
iPad Pro (11-inch) (2nd generation)
iPad Pro (12.9-inch) (4th generation)
iPad Pro (9.7-inch) | | iOS 13.6 | 11.6 | iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 8
iPhone 8 Plus
iPhone SE (2nd generation)
iPad (7th generation)
iPad Air (3rd generation)
iPad Pro (11-inch) (2nd generation)
iPad Pro (12.9-inch) (4th generation)
iPad Pro (9.7-inch) | | iOS 13.7 | 11.7 | iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 8
iPhone 8 Plus
iPhone SE (2nd generation)
iPad (7th generation)
iPad Air (3rd generation)
iPad Pro (11-inch) (2nd generation)
iPad Pro (12.9-inch) (4th generation)
iPad Pro (9.7-inch) | -| iOS 14.0 | 12.0 | iPod touch (7th generation)
iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 8
iPhone 8 Plus
iPhone SE (2nd generation)
iPad (7th generation)
iPad Air (3rd generation)
iPad Pro (11-inch) (2nd generation)
iPad Pro (12.9-inch) (4th generation)
iPad Pro (9.7-inch) | +| iOS 14.0 | 12.0
12.0 | iPod touch (7th generation)
iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 8
iPhone 8 Plus
iPhone SE (2nd generation)
iPad (7th generation)
iPad (8th generation)
iPad Air (3rd generation)
iPad Air (4th generation)
iPad Pro (11-inch) (2nd generation)
iPad Pro (12.9-inch) (4th generation)
iPad Pro (9.7-inch) | | tvOS 12.4 | 10.3 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | tvOS 13.0 | 11.0
11.1 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | tvOS 13.2 | 11.2.1 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | tvOS 13.3 | 11.3.1 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | tvOS 13.4 | 11.4
11.4.1
11.5
11.6
11.7 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | -| tvOS 14.0 | 12.0 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | +| tvOS 14.0 | 12.0
12.0 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | watchOS 5.3 | 10.3 | Apple Watch Series 2 - 38mm
Apple Watch Series 2 - 42mm
Apple Watch Series 3 - 38mm
Apple Watch Series 3 - 42mm
Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm | | watchOS 6.0 | 11.0
11.1 | Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm
Apple Watch Series 5 - 40mm
Apple Watch Series 5 - 44mm | | watchOS 6.1 | 11.2.1
11.3.1 | Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm
Apple Watch Series 5 - 40mm
Apple Watch Series 5 - 44mm | | watchOS 6.2 | 11.4
11.4.1
11.5
11.6
11.7 | Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm
Apple Watch Series 5 - 40mm
Apple Watch Series 5 - 44mm | -| watchOS 7.0 | 12.0 | Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm
Apple Watch Series 5 - 40mm
Apple Watch Series 5 - 44mm | +| watchOS 7.0 | 12.0
12.0 | Apple Watch Series 4 - 40mm
Apple Watch Series 4 - 44mm
Apple Watch Series 5 - 40mm
Apple Watch Series 5 - 44mm
Apple Watch Series 6 - 40mm
Apple Watch Series 6 - 44mm | ### Android #### Android SDK Tools From c646bf5912583568ff35fdf68964c1bab2958e63 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 2 Oct 2020 11:50:58 +0300 Subject: [PATCH 50/51] fix Update-DockerImages.ps1 installation --- images/win/Windows2016-Azure.json | 7 +------ images/win/Windows2019-Azure.json | 1 + .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 4 ++++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 77d57aef1..34c1abcb3 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -160,12 +160,6 @@ "type": "windows-restart", "restart_timeout": "30m" }, - { - "type": "powershell", - "scripts": [ - "{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1" - ] - }, { "type": "powershell", "valid_exit_codes": [ @@ -176,6 +170,7 @@ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], "scripts": [ + "{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1", "{{ template_dir }}/scripts/Installers/Install-VS.ps1", "{{ template_dir }}/scripts/Installers/Install-NET48.ps1", "{{ template_dir }}/scripts/Installers/Windows2016/Install-SSDT.ps1" diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 473051dba..10b6e5dc1 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -184,6 +184,7 @@ "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], "scripts": [ + "{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1", "{{ template_dir }}/scripts/Installers/Install-VS.ps1", "{{ template_dir }}/scripts/Installers/Install-NET48.ps1" ], diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 2f45ecde1..377331ada 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -230,4 +230,8 @@ $markdown += New-MDHeader "Android" -Level 3 $markdown += Build-AndroidTable | New-MDTable $markdown += New-MDNewLine +# Docker images section +$markdown += New-MDHeader "Cached Docker images" -Level 3 +$markdown += New-MDList -Style Unordered -Lines @(Get-CachedDockerImages) + $markdown | Out-File -FilePath "C:\InstalledSoftware.md" \ No newline at end of file From 70219fe6eeeab5e80724f9a6c8e2b10f6f9eea3b Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Mon, 5 Oct 2020 16:24:53 +0300 Subject: [PATCH 51/51] Add database tools section to Windows docs (#1706) * add database tools section to docs, removed sqlps powershell module * reverted SQLPS module changes * removed SqlServer module from tools, its listed in PS modules * delete function as its not needed Co-authored-by: Leonid Lapshin --- .../SoftwareReport/SoftwareReport.Generator.ps1 | 12 ++++++++---- .../scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 6 ------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 377331ada..c9f170309 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -74,7 +74,6 @@ $markdown += New-MDList -Style Unordered -Lines @( $markdown += New-MDHeader "Tools" -Level 3 $markdown += New-MDList -Style Unordered -Lines @( - (Get-AzCosmosDBEmulatorVersion), (Get-AzCopyVersion), (Get-BazelVersion), (Get-BazeliskVersion), @@ -91,15 +90,12 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-KubectlVersion), (Get-KindVersion), (Get-MinGWVersion), - (Get-MySQLVersion), (Get-MercurialVersion), (Get-NSISVersion), (Get-NewmanVersion), (Get-OpenSSLVersion), (Get-PackerVersion), (Get-PulumiVersion), - (Get-SQLPSVersion), - (Get-SQLServerPSVersion), (Get-SVNVersion), (Get-GHCVersion), (Get-CabalVersion), @@ -168,6 +164,14 @@ $markdown += New-MDHeader "Databases" -Level 3 $markdown += Build-DatabasesMarkdown $markdown += New-MDNewLine +$markdown += New-MDHeader "Database tools" -Level 3 +$markdown += New-MDList -Style Unordered -Lines @( + (Get-AzCosmosDBEmulatorVersion), + (Get-SQLPSVersion), + (Get-MySQLVersion) +) +$markdown += New-MDNewLine + $vs = Get-VisualStudioVersion $markdown += New-MDHeader "$($vs.Name)" -Level 3 $markdown += $vs | New-MDTable diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 0c0f39f55..6c4034871 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -125,12 +125,6 @@ function Get-SQLPSVersion { return "SQLPS $version" } -function Get-SQLServerPSVersion { - $module = Get-Module -Name SQLServer -ListAvailable - $version = $module.Version - return "SQLServer PS $version" -} - function Get-SVNVersion { $svnVersion = $(svn --version --quiet) return "Subversion (SVN) $svnVersion"