From 5d96d50f595c66e45212350b93ab77380d7b58fa Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 09:29:37 +0300 Subject: [PATCH 01/52] added pipx and yamllint --- images/macos/provision/core/commonutils.sh | 1 - images/macos/provision/core/pipx-packages.sh | 25 +++++++++++++++++++ images/macos/provision/core/python.sh | 14 ++++++++++- .../SoftwareReport.Common.psm1 | 4 +++ .../SoftwareReport.Generator.ps1 | 2 ++ images/macos/templates/macOS-10.14.json | 7 ++++++ images/macos/templates/macOS-10.15.json | 7 ++++++ images/macos/templates/macOS-11.0.json | 7 ++++++ images/macos/toolsets/toolset-10.14.json | 6 +++++ images/macos/toolsets/toolset-10.15.json | 14 ++++++++--- images/macos/toolsets/toolset-11.0.json | 10 ++++++-- 11 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 images/macos/provision/core/pipx-packages.sh diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 9b32d5c2c..5b3522f5b 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -22,7 +22,6 @@ binst_common_utils=( github/gh/gh p7zip ant - yamllint aria2 ) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh new file mode 100644 index 000000000..c01a4b975 --- /dev/null +++ b/images/macos/provision/core/pipx-packages.sh @@ -0,0 +1,25 @@ +source ~/utils/utils.sh + +export PATH="$PATH:/opt/pipx_bin" + +toolset=get_toolset_path +pipx_packages=$(jq -r ".pipx[] .package" $toolset) + +for package in $pipx_packages; do + python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset) + if [ "$python_version" != "null" ]; then + python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" + echo "Install $package into python $python_path" + pipx install $package --python $python_path + else + echo "Install $package into default python" + pipx install $package + fi + + # Run tests to determine that the software installed as expected + cmd=$(jq -r ".pipx[] | select(.package == \"$package\") .cmd" $toolset) + if ! command -v $cmd; then + echo "$package was not installed" + exit 1 + fi +done \ No newline at end of file diff --git a/images/macos/provision/core/python.sh b/images/macos/provision/core/python.sh index 41488642e..5bda9ef30 100755 --- a/images/macos/provision/core/python.sh +++ b/images/macos/provision/core/python.sh @@ -7,7 +7,19 @@ echo "Brew Installing Python 3" /usr/local/bin/brew install python3 echo "Brew Installing Python 2" -# Create local tap with formula due to python2 formula depreciation +# Create local tap with formula due to python2 formula depreciation /usr/local/bin/brew tap-new local/python2 FORMULA_PATH=$(/usr/local/bin/brew extract python@2 local/python2 | grep "Homebrew/Library/Taps") /usr/local/bin/brew install $FORMULA_PATH + +echo "Installing pipx" +export PIPX_BIN_DIR=/opt/pipx_bin +export PIPX_HOME=/opt/pipx + +brew install pipx +python3 -m pipx ensurepath + +echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" +echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" +echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc" + diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index c3fe75171..5c518d165 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -96,6 +96,10 @@ function Get-PipVersion { return "${versionPart1} ${versionPart2} ${versionPart3}" } +function Get-PipxVersion { + return "Pipx $(pipx --version 2> $null)" +} + function Get-NVMNodeVersionList { $nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh" $nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true" diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 87c944598..40214d7a6 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -81,6 +81,7 @@ $npmVersion = Run-Command "npm --version" $yarnVersion = Run-Command "yarn --version" $nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2 $pip3Version = Get-PipVersion -Version 3 +$pipxVersion = Get-PipxVersion $condaVersion = Invoke-Expression "conda --version" $rubyGemsVersion = Run-Command "gem --version" $composerVersion = Run-Command "composer --version" | Take-Part -Part 2 @@ -97,6 +98,7 @@ if ($os.IsLessThanBigSur) { $markdown += New-MDList -Style Unordered -Lines @( "Pip ${pip3Version}", + $pipxVersion, $bundlerVersion, "Carthage ${carthageVersion}", "CocoaPods ${cocoaPodsVersion}", diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 269ffa71f..3cb0b0705 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -196,6 +196,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 3dcc3d33e..65a0d12d4 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -195,6 +195,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index 6da9df38d..c732f7995 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -192,6 +192,13 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/toolsets/toolset-10.14.json b/images/macos/toolsets/toolset-10.14.json index e868f7699..fc1d44af1 100644 --- a/images/macos/toolsets/toolset-10.14.json +++ b/images/macos/toolsets/toolset-10.14.json @@ -257,5 +257,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index 8497a7100..e754bacf0 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -26,28 +26,28 @@ "mono":"6.12", "ios": "14.0", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_12_0", "mono":"6.12", "ios": "13.20", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_10_0", "mono":"6.10", "ios": "13.18", "mac": "6.18", - "android": "10.3" + "android": "10.3" }, { "symlink": "6_8_1", "mono":"6.8", "ios": "13.16", "mac": "6.16", - "android": "10.2" + "android": "10.2" }, { "symlink": "6_8_0", @@ -166,5 +166,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index 725da2188..8a739f913 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -26,14 +26,14 @@ "mono":"6.12", "ios": "14.0", "mac": "6.20", - "android": "11.0" + "android": "11.0" }, { "symlink": "6_12_0", "mono":"6.12", "ios": "13.20", "mac": "6.20", - "android": "11.0" + "android": "11.0" } ] }, @@ -91,5 +91,11 @@ "1.15.*" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file From 6742dd7a546df5c182a04a552d62ebb6eaaa41b9 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 14:58:13 +0300 Subject: [PATCH 02/52] resolved comments --- images/macos/provision/core/pipx-packages.sh | 9 +-------- images/macos/provision/core/python.sh | 5 ++--- images/macos/tests/Python.Tests.ps1 | 4 ++++ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh index c01a4b975..b755dede5 100644 --- a/images/macos/provision/core/pipx-packages.sh +++ b/images/macos/provision/core/pipx-packages.sh @@ -8,18 +8,11 @@ pipx_packages=$(jq -r ".pipx[] .package" $toolset) for package in $pipx_packages; do python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset) if [ "$python_version" != "null" ]; then - python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" + python_path="$HOME/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" echo "Install $package into python $python_path" pipx install $package --python $python_path else echo "Install $package into default python" pipx install $package fi - - # Run tests to determine that the software installed as expected - cmd=$(jq -r ".pipx[] | select(.package == \"$package\") .cmd" $toolset) - if ! command -v $cmd; then - echo "$package was not installed" - exit 1 - fi done \ No newline at end of file diff --git a/images/macos/provision/core/python.sh b/images/macos/provision/core/python.sh index 5bda9ef30..0c4058e31 100755 --- a/images/macos/provision/core/python.sh +++ b/images/macos/provision/core/python.sh @@ -13,11 +13,10 @@ FORMULA_PATH=$(/usr/local/bin/brew extract python@2 local/python2 | grep "Homebr /usr/local/bin/brew install $FORMULA_PATH echo "Installing pipx" -export PIPX_BIN_DIR=/opt/pipx_bin -export PIPX_HOME=/opt/pipx +export PIPX_BIN_DIR=/usr/local/opt/pipx_bin +export PIPX_HOME=/usr/local/opt/pipx brew install pipx -python3 -m pipx ensurepath echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" diff --git a/images/macos/tests/Python.Tests.ps1 b/images/macos/tests/Python.Tests.ps1 index 76cd8941b..43dc122ab 100644 --- a/images/macos/tests/Python.Tests.ps1 +++ b/images/macos/tests/Python.Tests.ps1 @@ -31,4 +31,8 @@ Describe "Python" { It "Pip 3 is available" { "pip3 --version" | Should -ReturnZeroExitCode } + + It "Pipx is available" { + "pipx --version" | Should -ReturnZeroExitCode + } } \ No newline at end of file From ef1a055d44d3210760ee96ac96ec0c124e72cd68 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 7 Oct 2020 16:20:27 +0300 Subject: [PATCH 03/52] added pipx to 10.13 --- images/macos/templates/macOS-10.13.json | 7 +++++++ images/macos/toolsets/toolset-10.13.json | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index 2190a6b4a..2300bf51e 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -183,6 +183,13 @@ "./provision/core/pypy.sh" ] }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/pipx-packages.sh" + ] + }, { "type": "shell", "inline": [ diff --git a/images/macos/toolsets/toolset-10.13.json b/images/macos/toolsets/toolset-10.13.json index fdb14d084..5157fe477 100644 --- a/images/macos/toolsets/toolset-10.13.json +++ b/images/macos/toolsets/toolset-10.13.json @@ -198,5 +198,11 @@ "3.6" ] } + ], + "pipx": [ + { + "package": "yamllint", + "cmd": "yamllint" + } ] } \ No newline at end of file From 451598b8c171adf7fea6da3715e7e41cdee0d368 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Fri, 9 Oct 2020 09:43:44 +0300 Subject: [PATCH 04/52] fixed pipx-packages.sh --- images/macos/provision/core/pipx-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/core/pipx-packages.sh b/images/macos/provision/core/pipx-packages.sh index b755dede5..658600fad 100644 --- a/images/macos/provision/core/pipx-packages.sh +++ b/images/macos/provision/core/pipx-packages.sh @@ -2,7 +2,7 @@ source ~/utils/utils.sh export PATH="$PATH:/opt/pipx_bin" -toolset=get_toolset_path +toolset=$(get_toolset_path) pipx_packages=$(jq -r ".pipx[] .package" $toolset) for package in $pipx_packages; do From f1da709f47f9f14aa559501fd260f2dcdc1448de Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Mon, 12 Oct 2020 11:10:02 +0300 Subject: [PATCH 05/52] fixed Get-PipxVersion --- images/macos/software-report/SoftwareReport.Common.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index 5c518d165..7616b81b7 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -97,7 +97,8 @@ function Get-PipVersion { } function Get-PipxVersion { - return "Pipx $(pipx --version 2> $null)" + $pipxVersion = Run-Command "pipx --version" -SuppressStderr + return "Pipx $pipxVersion" } function Get-NVMNodeVersionList { From a766bb164b81e837ab566c4993f7ef97bae4128c Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 02:45:29 +0700 Subject: [PATCH 06/52] added linter for ubuntu --- images.CI/linux-and-win/lint_ubuntu.ps1 | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 images.CI/linux-and-win/lint_ubuntu.ps1 diff --git a/images.CI/linux-and-win/lint_ubuntu.ps1 b/images.CI/linux-and-win/lint_ubuntu.ps1 new file mode 100644 index 000000000..7adcf70b9 --- /dev/null +++ b/images.CI/linux-and-win/lint_ubuntu.ps1 @@ -0,0 +1,34 @@ +param( + [Parameter(Mandatory)] [string] $path, + [Parameter(Mandatory)] [string] $pattern +) + +$ErrorActionPreference = "Stop" + +function Validate-Scripts { + Param ( + [Parameter(Mandatory=$true)] + [string[]]$Path, + [Parameter(Mandatory=$true)] + [string]$Pattern + ) + $WrongScript = New-Object System.Collections.Generic.List[System.Object] + Get-ChildItem $path | ForEach-Object { + if (Select-String -Path $($_.FullName) -Pattern $Pattern -Quiet) { + Write-Host "Pattern '$pattern' found in '$($_.FullName)'" + } + else { + Write-Host "Pattern '$pattern' not found in '$($_.FullName)'" + $WrongScript += $($_.FullName) + } + } + return $WrongScript +} + +$FailedScripts = Validate-Scripts -Path $path -Pattern "#/bin/bash -e" +if ($FailedScripts.Length -gt 0) { + $FailedScripts | ForEach-Object { + Write-Warning "The following script does not contain shebang: '$_'" + } + exit 1 +} \ No newline at end of file From 374bf8e5cddd2e849017fb2d0601ccb47d4a33e2 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 17:10:22 +0700 Subject: [PATCH 07/52] resolve comments --- images.CI/lint-shebang.ps1 | 34 +++++++++++++++++++++++++ images.CI/linux-and-win/lint_ubuntu.ps1 | 34 ------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 images.CI/lint-shebang.ps1 delete mode 100644 images.CI/linux-and-win/lint_ubuntu.ps1 diff --git a/images.CI/lint-shebang.ps1 b/images.CI/lint-shebang.ps1 new file mode 100644 index 000000000..6a2789f53 --- /dev/null +++ b/images.CI/lint-shebang.ps1 @@ -0,0 +1,34 @@ +param( + [Parameter(Mandatory)] [string] $path, + [Parameter(Mandatory)] [string] $pattern +) + +$ErrorActionPreference = "Stop" + +function Validate-Scripts { + Param ( + [Parameter(Mandatory=$true)] + [string[]]$Path, + [Parameter(Mandatory=$true)] + [string]$Pattern + ) + $ScriptsWithBrokenShebang = @() + Get-ChildItem $path | ForEach-Object { + if (Get-Content -Path $($_.FullName) | Select-Object -First 1 | Select-String -Pattern $Pattern -Quiet) { + Write-Host "Pattern '$Pattern' found in '$($_.FullName)'" + } + else { + Write-Host "Pattern '$Pattern' not found in '$($_.FullName)'" + $ScriptsWithBrokenShebang += $($_.FullName) + } + } + return $ScriptsWithBrokenShebang +} + +$ScriptsWithBrokenShebang = Validate-Scripts -Path $path -Pattern "#!/bin/bash -e" +if ($ScriptsWithBrokenShebang.Length -gt 0) { + $ScriptsWithBrokenShebang | ForEach-Object { + Write-Warning "The following script does not contain shebang: '$_'" + } + exit 1 +} \ No newline at end of file diff --git a/images.CI/linux-and-win/lint_ubuntu.ps1 b/images.CI/linux-and-win/lint_ubuntu.ps1 deleted file mode 100644 index 7adcf70b9..000000000 --- a/images.CI/linux-and-win/lint_ubuntu.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -param( - [Parameter(Mandatory)] [string] $path, - [Parameter(Mandatory)] [string] $pattern -) - -$ErrorActionPreference = "Stop" - -function Validate-Scripts { - Param ( - [Parameter(Mandatory=$true)] - [string[]]$Path, - [Parameter(Mandatory=$true)] - [string]$Pattern - ) - $WrongScript = New-Object System.Collections.Generic.List[System.Object] - Get-ChildItem $path | ForEach-Object { - if (Select-String -Path $($_.FullName) -Pattern $Pattern -Quiet) { - Write-Host "Pattern '$pattern' found in '$($_.FullName)'" - } - else { - Write-Host "Pattern '$pattern' not found in '$($_.FullName)'" - $WrongScript += $($_.FullName) - } - } - return $WrongScript -} - -$FailedScripts = Validate-Scripts -Path $path -Pattern "#/bin/bash -e" -if ($FailedScripts.Length -gt 0) { - $FailedScripts | ForEach-Object { - Write-Warning "The following script does not contain shebang: '$_'" - } - exit 1 -} \ No newline at end of file From fe4def773996201394af79bae3baf605d01402f3 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 17:24:06 +0700 Subject: [PATCH 08/52] resolve comments. --- images.CI/lint-shebang.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/images.CI/lint-shebang.ps1 b/images.CI/lint-shebang.ps1 index 6a2789f53..ffed13bd6 100644 --- a/images.CI/lint-shebang.ps1 +++ b/images.CI/lint-shebang.ps1 @@ -12,20 +12,22 @@ function Validate-Scripts { [Parameter(Mandatory=$true)] [string]$Pattern ) - $ScriptsWithBrokenShebang = @() + $ScriptWithoutShebangLine = @() Get-ChildItem $path | ForEach-Object { if (Get-Content -Path $($_.FullName) | Select-Object -First 1 | Select-String -Pattern $Pattern -Quiet) { Write-Host "Pattern '$Pattern' found in '$($_.FullName)'" } else { Write-Host "Pattern '$Pattern' not found in '$($_.FullName)'" - $ScriptsWithBrokenShebang += $($_.FullName) + $ScriptWithoutShebangLine += $($_.FullName) } } - return $ScriptsWithBrokenShebang + return $ScriptWithoutShebangLine } -$ScriptsWithBrokenShebang = Validate-Scripts -Path $path -Pattern "#!/bin/bash -e" +$ScriptsWithBrokenShebang = @() +$ScriptsWithBrokenShebang += Validate-Scripts -Path $path1 -Pattern "#!/bin/bash -e" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $path2 -Pattern "#!/bin/bash -e" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { Write-Warning "The following script does not contain shebang: '$_'" From 4f08343661c445b8a901c7923958f3494f7bcffd Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 17:25:30 +0700 Subject: [PATCH 09/52] added comments --- images.CI/lint-shebang.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images.CI/lint-shebang.ps1 b/images.CI/lint-shebang.ps1 index ffed13bd6..9e38bda22 100644 --- a/images.CI/lint-shebang.ps1 +++ b/images.CI/lint-shebang.ps1 @@ -26,8 +26,10 @@ function Validate-Scripts { } $ScriptsWithBrokenShebang = @() +# Check Ubuntu contains required shebang string $ScriptsWithBrokenShebang += Validate-Scripts -Path $path1 -Pattern "#!/bin/bash -e" -$ScriptsWithBrokenShebang += Validate-Scripts -Path $path2 -Pattern "#!/bin/bash -e" +# Check MacOS contains required shebang string +$ScriptsWithBrokenShebang += Validate-Scripts -Path $path2 -Pattern "#!/bin/bash -e -o pipefail" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { Write-Warning "The following script does not contain shebang: '$_'" From e88c5b8f09fdfae6d0c8a427d7847c7e2ae1f4c3 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 17:55:00 +0700 Subject: [PATCH 10/52] added all changes. --- images.CI/lint-shebang.ps1 | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/images.CI/lint-shebang.ps1 b/images.CI/lint-shebang.ps1 index 9e38bda22..233ed3344 100644 --- a/images.CI/lint-shebang.ps1 +++ b/images.CI/lint-shebang.ps1 @@ -1,8 +1,3 @@ -param( - [Parameter(Mandatory)] [string] $path, - [Parameter(Mandatory)] [string] $pattern -) - $ErrorActionPreference = "Stop" function Validate-Scripts { @@ -10,29 +5,32 @@ function Validate-Scripts { [Parameter(Mandatory=$true)] [string[]]$Path, [Parameter(Mandatory=$true)] - [string]$Pattern + [string]$ExpectedShebang ) $ScriptWithoutShebangLine = @() - Get-ChildItem $path | ForEach-Object { - if (Get-Content -Path $($_.FullName) | Select-Object -First 1 | Select-String -Pattern $Pattern -Quiet) { - Write-Host "Pattern '$Pattern' found in '$($_.FullName)'" + Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { + $shebangLine = Get-Content -Path $($_.FullName) | Select-Object -First 1 + if ($shebangLine -eq $ExpectedShebang) { + Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" } else { - Write-Host "Pattern '$Pattern' not found in '$($_.FullName)'" - $ScriptWithoutShebangLine += $($_.FullName) + Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" + $ScriptWithoutShebangLine += $($_.FullName) } } return $ScriptWithoutShebangLine } +$PathUbuntu = "./images/linux/scripts" +$PathMacOS = "./images/macos/provision" $ScriptsWithBrokenShebang = @() # Check Ubuntu contains required shebang string -$ScriptsWithBrokenShebang += Validate-Scripts -Path $path1 -Pattern "#!/bin/bash -e" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -Pattern "#!/bin/bash -e" # Check MacOS contains required shebang string -$ScriptsWithBrokenShebang += Validate-Scripts -Path $path2 -Pattern "#!/bin/bash -e -o pipefail" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -Pattern "#!/bin/bash -e -o pipefail" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { - Write-Warning "The following script does not contain shebang: '$_'" + Write-Warning "The following script does not contain shebang: '$_'" } - exit 1 + exit 1 } \ No newline at end of file From a191335ab6d7d44c9fba5d9df4557daf3ce6b049 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 18:06:14 +0700 Subject: [PATCH 11/52] last comments resolved. --- .../{lint-shebang.ps1 => shebang-linter.ps1} | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename images.CI/{lint-shebang.ps1 => shebang-linter.ps1} (72%) diff --git a/images.CI/lint-shebang.ps1 b/images.CI/shebang-linter.ps1 similarity index 72% rename from images.CI/lint-shebang.ps1 rename to images.CI/shebang-linter.ps1 index 233ed3344..f031f4a64 100644 --- a/images.CI/lint-shebang.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -7,16 +7,16 @@ function Validate-Scripts { [Parameter(Mandatory=$true)] [string]$ExpectedShebang ) - $ScriptWithoutShebangLine = @() - Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { - $shebangLine = Get-Content -Path $($_.FullName) | Select-Object -First 1 - if ($shebangLine -eq $ExpectedShebang) { + $ScriptWithoutShebangLine = @() + Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { + $shebangLine = Get-Content -Path $($_.FullName) | Select-Object -First 1 + if ($shebangLine -eq $ExpectedShebang) { Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" - } - else { + } + else { Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" $ScriptWithoutShebangLine += $($_.FullName) - } + } } return $ScriptWithoutShebangLine } @@ -24,13 +24,11 @@ function Validate-Scripts { $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" $ScriptsWithBrokenShebang = @() -# Check Ubuntu contains required shebang string $ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -Pattern "#!/bin/bash -e" -# Check MacOS contains required shebang string $ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -Pattern "#!/bin/bash -e -o pipefail" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { Write-Warning "The following script does not contain shebang: '$_'" - } + } exit 1 } \ No newline at end of file From 01e2f948f6c865470ee5476042b18205a1527bd6 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 18:31:14 +0700 Subject: [PATCH 12/52] added latest changes. --- .github/workflows/linter.yml | 5 +++++ images.CI/shebang-linter.ps1 | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 42eb7cad8..37636bed4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -23,3 +23,8 @@ jobs: VALIDATE_JSON: true VALIDATE_MD: true DEFAULT_BRANCH: ${{ github.base_ref }} + + - name: Checking shebang lines in MacOS and Ubuntu releases. + shell: powershell + run: | + ./images.CI/shebang-linter.ps1 diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index f031f4a64..bba5ed02e 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -24,8 +24,8 @@ function Validate-Scripts { $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" $ScriptsWithBrokenShebang = @() -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -Pattern "#!/bin/bash -e" -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -Pattern "#!/bin/bash -e -o pipefail" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -ExpectedShebang "#!/bin/bash -e" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang "#!/bin/bash -e -o pipefail" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { Write-Warning "The following script does not contain shebang: '$_'" From 6238508a2181d70d437b599bbd19b17baa73c882 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:02:18 +0700 Subject: [PATCH 13/52] added relative path instead of fullpath --- images.CI/shebang-linter.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index bba5ed02e..3397f99d5 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -9,13 +9,14 @@ function Validate-Scripts { ) $ScriptWithoutShebangLine = @() Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { - $shebangLine = Get-Content -Path $($_.FullName) | Select-Object -First 1 + $RelativePath = Join-Path $Path $($_.Name) + $shebangLine = Get-Content -Path $RelativePath | Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { - Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" + Write-Host "Pattern '$ExpectedShebang' found in '$RelativePath'" } else { - Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" - $ScriptWithoutShebangLine += $($_.FullName) + Write-Host "Pattern '$ExpectedShebang' not found in '$RelativePath'" + $ScriptWithoutShebangLine += $RelativePath } } return $ScriptWithoutShebangLine From 57c3deaaf6d2ea6afcadc2e9b75aec1363b1177a Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:30:57 +0700 Subject: [PATCH 14/52] addes spaces --- .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 37636bed4..921e5547e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,7 +4,7 @@ name: CI on: pull_request: - branches: [$default-branch] + branches: [ $default-branch ] jobs: build: From 65129b886edb6769e2809aa09793a5ecf2f962d7 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:31:29 +0700 Subject: [PATCH 15/52] changed name from CI to Linter --- .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 921e5547e..7b1def8c5 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,6 +1,6 @@ # CI Validation -name: CI +name: Linter on: pull_request: From ab806eaf303fe796203504469565ab7aacabbd25 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:33:55 +0700 Subject: [PATCH 16/52] intendation change --- .github/workflows/linter.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 7b1def8c5..d99d4a17a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -24,7 +24,7 @@ jobs: VALIDATE_MD: true DEFAULT_BRANCH: ${{ github.base_ref }} - - name: Checking shebang lines in MacOS and Ubuntu releases. - shell: powershell - run: | - ./images.CI/shebang-linter.ps1 + - name: Checking shebang lines in MacOS and Ubuntu releases. + shell: powershell + run: | + ./images.CI/shebang-linter.ps1 From 8d991b682f2d4b121cffc958e62497061529bd99 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:41:49 +0700 Subject: [PATCH 17/52] change branches --- .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 d99d4a17a..e4488530f 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,7 +4,7 @@ name: Linter on: pull_request: - branches: [ $default-branch ] + branches: [$default-branch] jobs: build: From e1ace194bb56e8338d68a805bfd43c1ba0adc500 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:44:17 +0700 Subject: [PATCH 18/52] stop --- .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 e4488530f..4a8697711 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,10 +1,10 @@ # CI Validation -name: Linter +name: CI on: pull_request: - branches: [$default-branch] + branches: [ $default-branch ] jobs: build: From df71273fa4d45f81e13016e11f4329aab23d3bbe Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:45:28 +0700 Subject: [PATCH 19/52] spaces --- .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 4a8697711..d99d4a17a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,6 +1,6 @@ # CI Validation -name: CI +name: Linter on: pull_request: From f4b59cee6f5cd98205c54e6013a0ddfba52909bf Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:47:35 +0700 Subject: [PATCH 20/52] ok --- images.CI/shebang-linter.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index 3397f99d5..1d2156980 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -1,5 +1,5 @@ $ErrorActionPreference = "Stop" - +# Comment here function Validate-Scripts { Param ( [Parameter(Mandatory=$true)] From d2fc140343a2cb62138e3d71cb314ebf7537d61f Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:49:07 +0700 Subject: [PATCH 21/52] removed dummy line --- images.CI/shebang-linter.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index 1d2156980..3397f99d5 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -1,5 +1,5 @@ $ErrorActionPreference = "Stop" -# Comment here + function Validate-Scripts { Param ( [Parameter(Mandatory=$true)] From 9ea40392dcab44796b7d95265b6141bcdf97571c Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:49:59 +0700 Subject: [PATCH 22/52] added additional trigger --- .github/workflows/linter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index d99d4a17a..88b97e1fb 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,6 +5,8 @@ name: Linter on: pull_request: branches: [ $default-branch ] + push: + branches: [ v-danurg/lint_shebang_ubuntu ] jobs: build: From 4b81b1dedccc629ff930cf24219eaf87de616851 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:53:45 +0700 Subject: [PATCH 23/52] powershell changed intendation --- .github/workflows/linter.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 88b97e1fb..7b04bc726 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -27,6 +27,5 @@ jobs: DEFAULT_BRANCH: ${{ github.base_ref }} - name: Checking shebang lines in MacOS and Ubuntu releases. - shell: powershell - run: | - ./images.CI/shebang-linter.ps1 + run: ./images.CI/shebang-linter.ps1 + shell: powershell From 6d776ba19b1f4431654659590dfe327381198f9c Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:55:47 +0700 Subject: [PATCH 24/52] powershell added as shell --- .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 7b04bc726..dd8ac0f82 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -28,4 +28,4 @@ jobs: - name: Checking shebang lines in MacOS and Ubuntu releases. run: ./images.CI/shebang-linter.ps1 - shell: powershell + shell: pwsh From b6357f0e0020679b35279fbe2d7b0bf1c11bd242 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:02:57 +0700 Subject: [PATCH 25/52] removed relative path --- images.CI/shebang-linter.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index 3397f99d5..b950fd32f 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -9,14 +9,13 @@ function Validate-Scripts { ) $ScriptWithoutShebangLine = @() Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { - $RelativePath = Join-Path $Path $($_.Name) - $shebangLine = Get-Content -Path $RelativePath | Select-Object -First 1 + $shebangLine = Get-Content -Path $($_.FullName)| Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { - Write-Host "Pattern '$ExpectedShebang' found in '$RelativePath'" + Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" } else { - Write-Host "Pattern '$ExpectedShebang' not found in '$RelativePath'" - $ScriptWithoutShebangLine += $RelativePath + Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" + $ScriptWithoutShebangLine += $($_.FullName) } } return $ScriptWithoutShebangLine From dfa109e3b663873d8d7b81b8acffe5339442eb8b Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:21:37 +0700 Subject: [PATCH 26/52] added additional logging --- images.CI/shebang-linter.ps1 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index b950fd32f..d2d084855 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -11,10 +11,10 @@ function Validate-Scripts { Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { $shebangLine = Get-Content -Path $($_.FullName)| Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { - Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" + Write-Host "[+] '$($_.FullName)'" } else { - Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" + Write-Host "[-] '$($_.FullName)'" $ScriptWithoutShebangLine += $($_.FullName) } } @@ -23,12 +23,20 @@ function Validate-Scripts { $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" +$PatternUbuntu = "#!/bin/bash -e" +$PatternMacOS = "#!/bin/bash -e -o pipefail" $ScriptsWithBrokenShebang = @() -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -ExpectedShebang "#!/bin/bash -e" -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang "#!/bin/bash -e -o pipefail" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -ExpectedShebang $PatternUbuntu +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang $PatternMacOS if ($ScriptsWithBrokenShebang.Length -gt 0) { + Write-Host "The following scripts have incorrect shebang:" $ScriptsWithBrokenShebang | ForEach-Object { - Write-Warning "The following script does not contain shebang: '$_'" + Write-Host "- '$_'" } + Write-Host "Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'" + Write-Host "Expected shebang for scripts in 'images/macos' folder is '$PatternMacOS'" exit 1 + else { + Write-Host "All scripts have correct shebang." + } } \ No newline at end of file From be8eba42a1b86ac4c8fa02ca6dbd55913245db5f Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:26:48 +0700 Subject: [PATCH 27/52] added error to linter --- images.CI/shebang-linter.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index d2d084855..26248e269 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -31,10 +31,10 @@ $ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang if ($ScriptsWithBrokenShebang.Length -gt 0) { Write-Host "The following scripts have incorrect shebang:" $ScriptsWithBrokenShebang | ForEach-Object { - Write-Host "- '$_'" + Write-Host "##[error] - '$_'" } - Write-Host "Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'" - Write-Host "Expected shebang for scripts in 'images/macos' folder is '$PatternMacOS'" + Write-Host "##[error] Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'" + Write-Host "##[error] Expected shebang for scripts in 'images/macos' folder is '$PatternMacOS'" exit 1 else { Write-Host "All scripts have correct shebang." From 955aec5bef2a3bddc1fcf1a300463672a874e88b Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:32:58 +0700 Subject: [PATCH 28/52] added new linter --- images.CI/shebang-linter.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index 26248e269..34f952001 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -9,17 +9,16 @@ function Validate-Scripts { ) $ScriptWithoutShebangLine = @() Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { - $shebangLine = Get-Content -Path $($_.FullName)| Select-Object -First 1 + $relativePath = Resolve-Path $_.FullName -Relative + $shebangLine = Get-Content -Path $.FullName | Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { - Write-Host "[+] '$($_.FullName)'" + Write-Host "[+] '$relativePath'" } else { - Write-Host "[-] '$($_.FullName)'" - $ScriptWithoutShebangLine += $($_.FullName) + Write-Host "[-] 'relativePath'" + $ScriptWithoutShebangLine += $relativePath } } - return $ScriptWithoutShebangLine -} $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" @@ -29,11 +28,11 @@ $ScriptsWithBrokenShebang = @() $ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -ExpectedShebang $PatternUbuntu $ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang $PatternMacOS if ($ScriptsWithBrokenShebang.Length -gt 0) { - Write-Host "The following scripts have incorrect shebang:" + Write-Host "`n`n`n##[error] The following scripts have incorrect shebang:" $ScriptsWithBrokenShebang | ForEach-Object { - Write-Host "##[error] - '$_'" + Write-Host "##[error] '$_'" } - Write-Host "##[error] Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'" + Write-Host "`n`n##[error] Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'" Write-Host "##[error] Expected shebang for scripts in 'images/macos' folder is '$PatternMacOS'" exit 1 else { From d237f71482563ca0cd4c4364fae6853a62679ae4 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:36:03 +0700 Subject: [PATCH 29/52] added intendation --- images.CI/shebang-linter.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index 34f952001..bf8912868 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -19,6 +19,7 @@ function Validate-Scripts { $ScriptWithoutShebangLine += $relativePath } } +} $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" From 8786b3e436985bf14cf15e3ee03e2e3786068309 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 21:39:12 +0700 Subject: [PATCH 30/52] added corrected things --- images.CI/shebang-linter.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index bf8912868..b57703d76 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -10,12 +10,12 @@ function Validate-Scripts { $ScriptWithoutShebangLine = @() Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { $relativePath = Resolve-Path $_.FullName -Relative - $shebangLine = Get-Content -Path $.FullName | Select-Object -First 1 + $shebangLine = Get-Content -Path $_.FullName | Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { Write-Host "[+] '$relativePath'" } else { - Write-Host "[-] 'relativePath'" + Write-Host "[-] '$relativePath'" $ScriptWithoutShebangLine += $relativePath } } From b3a337ea8a854615d20922742b6fa52766ed1b53 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Wed, 14 Oct 2020 02:04:32 +0700 Subject: [PATCH 31/52] returned return --- images.CI/shebang-linter.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index b57703d76..a3862f658 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -19,6 +19,7 @@ function Validate-Scripts { $ScriptWithoutShebangLine += $relativePath } } + return $ScriptWithoutShebangLine } $PathUbuntu = "./images/linux/scripts" From 47f5cf3834fa303f9ce3b945f566943be5fb5107 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Wed, 14 Oct 2020 02:44:52 +0700 Subject: [PATCH 32/52] change trigger to main --- .github/workflows/linter.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index dd8ac0f82..48ec7dd65 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,10 +4,8 @@ name: Linter on: pull_request: - branches: [ $default-branch ] - push: - branches: [ v-danurg/lint_shebang_ubuntu ] - + branches: [ main ] + jobs: build: name: Lint JSON & MD files From 27361ddb4a2fbf5ee2e01f87b16d70743f4b84d9 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 19 Oct 2020 10:25:04 +0300 Subject: [PATCH 33/52] resize disk using powershell --- images/win/scripts/Installers/Initialize-VM.ps1 | 12 ++++-------- images/win/windows2019.json | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/images/win/scripts/Installers/Initialize-VM.ps1 b/images/win/scripts/Installers/Initialize-VM.ps1 index ad853bb74..a8509be00 100644 --- a/images/win/scripts/Installers/Initialize-VM.ps1 +++ b/images/win/scripts/Installers/Initialize-VM.ps1 @@ -128,11 +128,7 @@ if (Test-IsWin19) { } # Expand disk size of OS drive -New-Item -Path d:\ -Name cmds.txt -ItemType File -Force -Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND" - -$expandResult = (diskpart /s 'd:\cmds.txt') -Write-Host $expandResult - -Write-Host "Disk sizes after expansion" -wmic logicaldisk get size,freespace,caption +$driveLetter = "C" +$size = Get-PartitionSupportedSize -DriveLetter $driveLetter +Resize-Partition -DriveLetter $driveLetter -Size $size.SizeMax +Get-Partition | Select-Object DriveLetter, PartitionNumber, Size \ No newline at end of file diff --git a/images/win/windows2019.json b/images/win/windows2019.json index 6609b5b38..6b9f3a868 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -13,7 +13,7 @@ "virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}", "virtual_network_subnet_name": "{{env `VNET_SUBNET`}}", "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", - "vm_size": "Standard_D4_v2", + "vm_size": "Standard_DS4_v2", "run_scan_antivirus": "false", "root_folder": "C:", "toolset_json_path": "{{env `TEMP`}}\\toolset.json", From 3633730364c0eac3a457f0abd385e5b0d19e63f6 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 19 Oct 2020 10:33:43 +0300 Subject: [PATCH 34/52] use Get-Volume --- images/win/scripts/Installers/Initialize-VM.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Initialize-VM.ps1 b/images/win/scripts/Installers/Initialize-VM.ps1 index a8509be00..027728727 100644 --- a/images/win/scripts/Installers/Initialize-VM.ps1 +++ b/images/win/scripts/Installers/Initialize-VM.ps1 @@ -131,4 +131,4 @@ if (Test-IsWin19) { $driveLetter = "C" $size = Get-PartitionSupportedSize -DriveLetter $driveLetter Resize-Partition -DriveLetter $driveLetter -Size $size.SizeMax -Get-Partition | Select-Object DriveLetter, PartitionNumber, Size \ No newline at end of file +Get-Volume | Select-Object DriveLetter, SizeRemaining, Size | Sort-Object DriveLetter \ No newline at end of file From 114da935564e7339abcc111d14e1f0defa5e823e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 20 Oct 2020 13:47:33 +0300 Subject: [PATCH 35/52] rework chrome installation --- images/macos/provision/core/chrome.sh | 4 +++- images/macos/provision/utils/utils.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/core/chrome.sh b/images/macos/provision/core/chrome.sh index 203faee74..aad4fb4df 100644 --- a/images/macos/provision/core/chrome.sh +++ b/images/macos/provision/core/chrome.sh @@ -1,5 +1,7 @@ +source ~/utils/utils.sh + echo "Installing Chrome..." -brew cask install google-chrome +brew_install_ignoring_sha256 "google-chrome" echo "Installing Chrome Driver" brew cask install chromedriver diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 85881c7e3..1bca5c8a0 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -96,4 +96,15 @@ get_default_xcode_from_toolset() { verlte() { sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1) [ "$1" = "$sortedVersion" ] +} + +brew_install_ignoring_sha256() { + local TOOL_NAME=$1 + + CASK_DIR=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks + chmod a+w "$CASK_DIR/$TOOL_NAME.rb" + SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') + sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" + brew cask install $TOOL_NAME + sed -i '' "s/:no_check/:$SHA/" "$CASK_DIR/$TOOL_NAME.rb" } \ No newline at end of file From edff9f791bade856d31e67e25fa191500d429c96 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 08:33:58 +0300 Subject: [PATCH 36/52] updated json files --- images/macos/templates/macOS-10.13.json | 8 +------- images/macos/templates/macOS-10.14.json | 10 ++-------- images/macos/templates/macOS-10.15.json | 10 ++-------- images/macos/templates/macOS-11.0.json | 10 ++-------- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index aa43650a4..9ebd56e6d 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -181,13 +181,7 @@ "./provision/core/edge.sh", "./provision/core/firefox.sh", "./provision/core/toolcache-high-sierra.sh", - "./provision/core/pypy.sh" - ] - }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ + "./provision/core/pypy.sh", "./provision/core/pipx-packages.sh" ] }, diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 017bc6074..c03cc72aa 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -186,7 +186,8 @@ "./provision/core/miniconda.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/toolcache.sh", - "./provision/core/pypy.sh" + "./provision/core/pypy.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -197,13 +198,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index cf225d411..cf49ef571 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -185,7 +185,8 @@ "./provision/core/firefox.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/toolcache.sh", - "./provision/core/pypy.sh" + "./provision/core/pypy.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -196,13 +197,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index d1f54d316..585a93542 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -181,7 +181,8 @@ "./provision/core/chrome.sh", "./provision/core/edge.sh", "./provision/core/firefox.sh", - "./provision/core/toolcache.sh" + "./provision/core/toolcache.sh", + "./provision/core/pipx-packages.sh" ], "environment_vars": [ "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" @@ -192,13 +193,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}", "scripts": "./provision/core/toolset.ps1" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", - "scripts": [ - "./provision/core/pipx-packages.sh" - ] - }, { "type": "shell", "execute_command": "ruby {{ .Path }}", From 1ddf2470ababf200d29e6abbd0600899215e982d Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 12:44:54 +0300 Subject: [PATCH 37/52] fixed function --- images/macos/provision/utils/utils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 1bca5c8a0..7f2958976 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -98,13 +98,14 @@ verlte() { [ "$1" = "$sortedVersion" ] } -brew_install_ignoring_sha256() { +brew_cask_install_ignoring_sha256() { local TOOL_NAME=$1 - CASK_DIR=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks + CASK_DIR="$(brew --repo homebrew/cask)/Casks" chmod a+w "$CASK_DIR/$TOOL_NAME.rb" SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" brew cask install $TOOL_NAME - sed -i '' "s/:no_check/:$SHA/" "$CASK_DIR/$TOOL_NAME.rb" + cd $CASK_DIR + git reset --hard } \ No newline at end of file From 00bb4818cec8f8676369d59f0eb33f7802ca37f2 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 15:50:53 +0300 Subject: [PATCH 38/52] fixed pipx packages tests --- images/macos/tests/Linters.Tests.ps1 | 4 ---- images/macos/tests/PipxPackages.Tests.ps1 | 7 +++++++ images/macos/toolsets/toolset-10.13.json | 2 +- images/macos/toolsets/toolset-10.14.json | 2 +- images/macos/toolsets/toolset-10.15.json | 2 +- images/macos/toolsets/toolset-11.0.json | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 images/macos/tests/PipxPackages.Tests.ps1 diff --git a/images/macos/tests/Linters.Tests.ps1 b/images/macos/tests/Linters.Tests.ps1 index 3b7b8e0df..31d3698cc 100644 --- a/images/macos/tests/Linters.Tests.ps1 +++ b/images/macos/tests/Linters.Tests.ps1 @@ -3,10 +3,6 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" $os = Get-OSVersion Describe "Linters" { - It "yamllint" { - "yamllint --version" | Should -ReturnZeroExitCode - } - It "SwiftLint" -Skip:($os.IsHighSierra) { "swiftlint version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/PipxPackages.Tests.ps1 b/images/macos/tests/PipxPackages.Tests.ps1 new file mode 100644 index 000000000..ed9819388 --- /dev/null +++ b/images/macos/tests/PipxPackages.Tests.ps1 @@ -0,0 +1,7 @@ +Describe "PipxPackages" { + $pipxToolset = Get-ToolsetValue "pipx" + $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } + It "" -TestCases $testCases { + "$cmd" | Should -ReturnZeroExitCode + } +} \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.13.json b/images/macos/toolsets/toolset-10.13.json index f1ce3b065..3bf629685 100644 --- a/images/macos/toolsets/toolset-10.13.json +++ b/images/macos/toolsets/toolset-10.13.json @@ -198,7 +198,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.14.json b/images/macos/toolsets/toolset-10.14.json index f1c70a837..aa1b41019 100644 --- a/images/macos/toolsets/toolset-10.14.json +++ b/images/macos/toolsets/toolset-10.14.json @@ -258,7 +258,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index e2debc9f2..c54db9197 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -167,7 +167,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file diff --git a/images/macos/toolsets/toolset-11.0.json b/images/macos/toolsets/toolset-11.0.json index e5cf3e64f..ed8903d38 100644 --- a/images/macos/toolsets/toolset-11.0.json +++ b/images/macos/toolsets/toolset-11.0.json @@ -92,7 +92,7 @@ "pipx": [ { "package": "yamllint", - "cmd": "yamllint" + "cmd": "yamllint --version" } ] } \ No newline at end of file From 38bc88214f8e65cc04dff4f728f363defa6d8c78 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 21 Oct 2020 16:36:03 +0300 Subject: [PATCH 39/52] fixed brew_cask_install_ignoring_sha256 function --- images/macos/provision/utils/utils.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 7f2958976..97e9b18c5 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -106,6 +106,7 @@ brew_cask_install_ignoring_sha256() { SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" brew cask install $TOOL_NAME - cd $CASK_DIR - git reset --hard + pushd $CASK_DIR + git checkout HEAD -- "$TOOL_NAME.rb" + popd } \ No newline at end of file From 62eca78ba7e61a60a7c9e2952f674ebb2b06b06e Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Thu, 22 Oct 2020 09:48:03 +0300 Subject: [PATCH 40/52] fixed naming --- images/macos/provision/core/chrome.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/core/chrome.sh b/images/macos/provision/core/chrome.sh index aad4fb4df..5f8b4bdde 100644 --- a/images/macos/provision/core/chrome.sh +++ b/images/macos/provision/core/chrome.sh @@ -1,7 +1,7 @@ source ~/utils/utils.sh echo "Installing Chrome..." -brew_install_ignoring_sha256 "google-chrome" +brew_cask_install_ignoring_sha256 "google-chrome" echo "Installing Chrome Driver" brew cask install chromedriver From dee484a90ce67d42f5df91a42b618cdd14b2a8f2 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 22 Oct 2020 10:49:07 +0300 Subject: [PATCH 41/52] remove chmod --- images/linux/scripts/installers/homebrew.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/images/linux/scripts/installers/homebrew.sh b/images/linux/scripts/installers/homebrew.sh index 865923f25..dd9e8f9e5 100644 --- a/images/linux/scripts/installers/homebrew.sh +++ b/images/linux/scripts/installers/homebrew.sh @@ -12,9 +12,6 @@ source $HELPER_SCRIPTS/etc-environment.sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) -# Make brew files and directories writable by any user -sudo chmod -R o+w $HOMEBREW_PREFIX - # Update /etc/environemnt ## Put HOMEBREW_* variables brew shellenv|grep 'export HOMEBREW'|sed -E 's/^export (.*);$/\1/' | sudo tee -a /etc/environment From 44d1f85e34c64c03adb3a25c51b5f87d30cbe092 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Sat, 24 Oct 2020 23:30:27 +0700 Subject: [PATCH 42/52] add missed shebang --- images/linux/scripts/base/apt.sh | 2 +- images/linux/scripts/base/repos.sh | 2 +- images/linux/scripts/helpers/etc-environment.sh | 2 +- images/linux/scripts/helpers/install.sh | 2 +- images/linux/scripts/helpers/os.sh | 2 +- images/linux/scripts/installers/pipx-packages.sh | 2 +- .../provision/bootstrap-provisioner/installNewProvisioner.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/images/linux/scripts/base/apt.sh b/images/linux/scripts/base/apt.sh index 8afcbe8d2..114708bef 100644 --- a/images/linux/scripts/base/apt.sh +++ b/images/linux/scripts/base/apt.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e export DEBIAN_FRONTEND=noninteractive apt-get -yq update diff --git a/images/linux/scripts/base/repos.sh b/images/linux/scripts/base/repos.sh index 4ecd2028c..9005d32aa 100644 --- a/images/linux/scripts/base/repos.sh +++ b/images/linux/scripts/base/repos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e ################################################################################ ## File: repos.sh ## Desc: Installs official Microsoft package repos for the distribution diff --git a/images/linux/scripts/helpers/etc-environment.sh b/images/linux/scripts/helpers/etc-environment.sh index 24801723e..eba0ecc05 100644 --- a/images/linux/scripts/helpers/etc-environment.sh +++ b/images/linux/scripts/helpers/etc-environment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e ################################################################################ ## File: etc-environment.sh ## Desc: Helper functions for source and modify /etc/environment diff --git a/images/linux/scripts/helpers/install.sh b/images/linux/scripts/helpers/install.sh index bb1befe22..e42cd3194 100644 --- a/images/linux/scripts/helpers/install.sh +++ b/images/linux/scripts/helpers/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e ################################################################################ ## File: install.sh ## Desc: Helper functions for installing tools diff --git a/images/linux/scripts/helpers/os.sh b/images/linux/scripts/helpers/os.sh index 9c30c811a..8bec86080 100644 --- a/images/linux/scripts/helpers/os.sh +++ b/images/linux/scripts/helpers/os.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e ################################################################################ ## File: install-helpers.sh ## Desc: Helper functions for installing tools diff --git a/images/linux/scripts/installers/pipx-packages.sh b/images/linux/scripts/installers/pipx-packages.sh index 07e1427e3..3b625fe41 100644 --- a/images/linux/scripts/installers/pipx-packages.sh +++ b/images/linux/scripts/installers/pipx-packages.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e ################################################################################ ## File: pipx-packages.sh ## Desc: Install tools via pipx diff --git a/images/macos/provision/bootstrap-provisioner/installNewProvisioner.sh b/images/macos/provision/bootstrap-provisioner/installNewProvisioner.sh index 79a3afdf2..e588c670c 100644 --- a/images/macos/provision/bootstrap-provisioner/installNewProvisioner.sh +++ b/images/macos/provision/bootstrap-provisioner/installNewProvisioner.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e -o pipefail BOOTSTRAP_PATH="$1" ProvisionerPackageUri="$2" ProvisionerScriptUri="$3" From 47eaa69646becdb28d3de6b28d92a16a18972b73 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Mon, 26 Oct 2020 14:37:18 +0300 Subject: [PATCH 43/52] [macOS] Improve select datastore script (#1892) * modify script to set tages * add vmname * nitpicks * add remove tag --- .../azure-pipelines/image-generation.yml | 7 +- images.CI/macos/move-vm.ps1 | 7 ++ images.CI/macos/select-datastore.ps1 | 87 ++++++++++++++----- 3 files changed, 75 insertions(+), 26 deletions(-) diff --git a/images.CI/macos/azure-pipelines/image-generation.yml b/images.CI/macos/azure-pipelines/image-generation.yml index 89216e216..60837bc1a 100644 --- a/images.CI/macos/azure-pipelines/image-generation.yml +++ b/images.CI/macos/azure-pipelines/image-generation.yml @@ -52,7 +52,8 @@ jobs: inputs: targetType: 'filePath' filePath: ./images.CI/macos/select-datastore.ps1 - arguments: -VIServer "$(vcenter-server-v2)" ` + arguments: -VMName "$(VirtualMachineName)" ` + -VIServer "$(vcenter-server-v2)" ` -VIUserName "$(vcenter-username-v2)" ` -VIPassword "$(vcenter-password-v2)" @@ -121,8 +122,8 @@ jobs: condition: always() - task: PowerShell@2 - displayName: 'Move vm to cold storage' - condition: succeededOrFailed() + displayName: 'Move vm to cold storage and clear datastore tag' + condition: always() inputs: targetType: 'filePath' filePath: ./images.CI/macos/move-vm.ps1 diff --git a/images.CI/macos/move-vm.ps1 b/images.CI/macos/move-vm.ps1 index 698721409..37e839066 100644 --- a/images.CI/macos/move-vm.ps1 +++ b/images.CI/macos/move-vm.ps1 @@ -48,6 +48,13 @@ Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking # Connection to a vCenter Server system Connect-VCServer +# Clear previously assigned tag with VM Name +try { + Remove-Tag $VMName -Confirm:$false +} catch { + Write-Host "Tag with $VMName doesn't exist" +} + $vm = Get-VM $VMName if ($env:AGENT_JOBSTATUS -eq 'Failed') { diff --git a/images.CI/macos/select-datastore.ps1 b/images.CI/macos/select-datastore.ps1 index d6477700c..2884fdf46 100644 --- a/images.CI/macos/select-datastore.ps1 +++ b/images.CI/macos/select-datastore.ps1 @@ -20,6 +20,10 @@ vCenter password (Example "12345678") [CmdletBinding()] param( + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string]$VMName, + [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$VIServer, @@ -30,35 +34,72 @@ param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] - [string]$VIPassword + [string]$VIPassword, + + [string]$TagCategory = "Busy" ) # Import helpers module Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking +function Select-DataStore { + param ( + [string]$VMName, + [string]$TagCategory, + [string]$TemplateDatastore = "ds-local-Datastore-*", + [int]$ThresholdInGb = 400, + [int]$VMCount = 2, + [int]$Retries = 5 + ) + + # 1. Name starts with ds-local-Datastore + # 2. FreespaceGB > 400 Gb + # 3. VM count on a datastore < 2 + + Write-Host "Start Datastore selection process..." + $allDatastores = Get-Datastore -Name $templateDatastore | Where-Object { $_.State -eq "Available" } + $buildDatastore = $allDatastores | Where-Object { $_.FreeSpaceGB -ge $thresholdInGb } | Where-Object { + $vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch "^\.").Count + $vmOnDatastore -lt $vmCount + } | Select-Object -ExpandProperty Name -First 1 + + $tag = Get-Tag -Category $TagCategory -Name $VMName -ErrorAction Ignore + if (-not $tag) + { + $tag = New-Tag -Name $VMName -Category $TagCategory + } + + New-TagAssignment -Tag $tag -Entity $buildDatastore | Out-Null + + # Wait for 60 seconds to check if any other tags are assigned to the same datastore + Start-Sleep -Seconds 60 + # Take only first 2 tags, all the others will go to the next round + $tagAssignments = (Get-TagAssignment -Entity $buildDatastore).Tag.Name | Select-Object -First 2 + $isAllow = $tagAssignments -contains $VMName + + if ($isAllow) + { + Write-Host "Datastore selected successfully" + Write-Host "##vso[task.setvariable variable=buildDatastore;issecret=true]$buildDatastore" + return + } + + # Remove the tag if datastore wasn't selected + Remove-Tag $tag -Confirm:$false + + $retries-- + if ($retries -le 0) + { + Write-Host "##vso[task.LogIssue type=error;]No datastores found for the condition" + exit 1 + } + + Write-Host "Datastore select failed, $retries left" + Select-DataStore -VMName $VMName -TagCategory $TagCategory -Retries $retries +} + # Connection to a vCenter Server system Connect-VCServer # Get a target datastore for current deployment -# 1. Name starts with ds-local-Datastore -# 2. FreespaceGB > 400 Gb -# 3. VM count on a datastore < 2 -$templateDatastore = "ds-local-Datastore-*" -$thresholdInGb = 400 -$vmCount = 2 -$allDatastores = Get-Datastore -Name $templateDatastore | Where-Object { $_.State -eq "Available" } -$buildDatastore = $allDatastores | Where-Object { $_.FreeSpaceGB -ge $thresholdInGb } | Where-Object { - $vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch "^\.").Count - $vmOnDatastore -lt $vmCount - } | Select-Object -ExpandProperty Name -First 1 - -if ($buildDatastore) -{ - Write-Host "Datastore selected successfully" - Write-Host "##vso[task.setvariable variable=buildDatastore;issecret=true]$buildDatastore" -} -else -{ - Write-Host "##vso[task.LogIssue type=error;]No datastores found for the condition" - exit 1 -} \ No newline at end of file +Select-DataStore -VMName $VMName -TagCategory $TagCategory From 48e266a55a3c4aa19b715b299ac5729fdb6379a8 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Mon, 26 Oct 2020 16:41:26 +0300 Subject: [PATCH 44/52] [macOS] remove workaround for MS edge (#1898) --- images/macos/provision/core/edge.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/images/macos/provision/core/edge.sh b/images/macos/provision/core/edge.sh index da1673e0a..bd0ffeddb 100644 --- a/images/macos/provision/core/edge.sh +++ b/images/macos/provision/core/edge.sh @@ -3,11 +3,7 @@ source ~/utils/utils.sh echo "Installing Microsoft Edge..." -# Workaround to install version 85 since webdriver is broken for 86 -cd "$(brew --repo homebrew/homebrew-cask)" -git checkout 81f9d08d2b9b7557c0178621078cf59d2c5db2bc brew cask install microsoft-edge -git checkout master EDGE_INSTALLATION_PATH="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" EDGE_VERSION=$("$EDGE_INSTALLATION_PATH" --version | cut -d' ' -f 3) From 4444dfd517ec0bc970a8c1bd8dbc2a902b9db97c Mon Sep 17 00:00:00 2001 From: MaksimZhukov Date: Mon, 26 Oct 2020 17:41:40 +0300 Subject: [PATCH 45/52] Fix Xamarin issue with Xcode symlink --- images/macos/provision/core/xamarin.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/macos/provision/core/xamarin.sh b/images/macos/provision/core/xamarin.sh index 86dc1a0fe..18eef3219 100755 --- a/images/macos/provision/core/xamarin.sh +++ b/images/macos/provision/core/xamarin.sh @@ -9,6 +9,7 @@ XAMARIN_MAC_VERSIONS=($(get_toolset_value '.xamarin."mac-versions" | reverse | . XAMARIN_ANDROID_VERSIONS=($(get_toolset_value '.xamarin."android-versions" | reverse | .[]')) LATEST_SDK_SYMLINK=$(get_toolset_value '.xamarin.bundles[0].symlink') CURRENT_SDK_SYMLINK=$(get_toolset_value '.xamarin."bundle-default"') +DEFAULT_XCODE_VERSION=$(get_default_xcode_from_toolset) if [ "$CURRENT_SDK_SYMLINK" == "latest" ]; then CURRENT_SDK_SYMLINK=$LATEST_SDK_SYMLINK @@ -82,3 +83,8 @@ popd echo "Clean up packages..." sudo rm -rf "$TMPMOUNT" + +# Fix Xamarin issue with Xcode symlink: https://github.com/xamarin/xamarin-macios/issues/9960 +PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin" +mkdir -p $PREFERENCES_XAMARIN_DIR +/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app" $PREFERENCES_XAMARIN_DIR/Settings.plist From b53fc3daba47f4064fa6beef3157044edb4a9de2 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 27 Oct 2020 07:52:15 +0300 Subject: [PATCH 46/52] Update readme and issue templates with MacOS 11.0 --- .github/ISSUE_TEMPLATE/bug-report.md | 7 ++++--- .github/ISSUE_TEMPLATE/tool-request.md | 7 ++++--- README.md | 8 +++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index b95d5ebc2..cf1a53405 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -17,10 +17,11 @@ A clear and concise description of what the bug is, and why you consider it to b **Virtual environments affected** +- [ ] Ubuntu 16.04 +- [ ] Ubuntu 18.04 +- [ ] Ubuntu 20.04 - [ ] macOS 10.15 -- [ ] Ubuntu 16.04 LTS -- [ ] Ubuntu 18.04 LTS -- [ ] Ubuntu 20.04 LTS +- [ ] macOS 11.0 - [ ] Windows Server 2016 R2 - [ ] Windows Server 2019 diff --git a/.github/ISSUE_TEMPLATE/tool-request.md b/.github/ISSUE_TEMPLATE/tool-request.md index 2eeb87378..72fdd0064 100644 --- a/.github/ISSUE_TEMPLATE/tool-request.md +++ b/.github/ISSUE_TEMPLATE/tool-request.md @@ -25,10 +25,11 @@ assignees: '' **Virtual environments affected** +- [ ] Ubuntu 16.04 +- [ ] Ubuntu 18.04 +- [ ] Ubuntu 20.04 - [ ] macOS 10.15 -- [ ] Ubuntu 16.04 LTS -- [ ] Ubuntu 18.04 LTS -- [ ] Ubuntu 20.04 LTS +- [ ] macOS 11.0 - [ ] Windows Server 2016 R2 - [ ] Windows Server 2019 diff --git a/README.md b/README.md index b3c596491..99086a724 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,18 @@ For general questions about using the virtual environments or writing your Actio | Ubuntu 20.04 | `ubuntu-20.04` | [ubuntu-20.04] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu20&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu20&redirect=1) | Ubuntu 18.04 | `ubuntu-latest` or `ubuntu-18.04` | [ubuntu-18.04] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu18&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu18&redirect=1) | Ubuntu 16.04 | `ubuntu-16.04` | [ubuntu-16.04] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu16&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu16&redirect=1) | -| macOS 10.15 | `macos-latest` or `macos-10.15` | [macOS-10.15] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=MacOS&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=MacOS&redirect=1) +| macOS 11.0 | `macos-11.0` | [macOS-11.0] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-11.0&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-11.0&redirect=1) +| macOS 10.15 | `macos-latest` or `macos-10.15` | [macOS-10.15] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macOS-10.15&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macOS-10.15&redirect=1) | Windows Server 2019 | `windows-latest` or `windows-2019` | [windows-2019] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2019&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2019&redirect=1) | Windows Server 2016 | `windows-2016` | [windows-2016] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2016&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2016&redirect=1) ``` The Ubuntu 20.04 virtual environment is currently provided as a preview only. The "ubuntu-latest" YAML workflow label still uses the Ubuntu 18.04 virtual environment. ``` +``` +The MacOS 11.0 virtual environment is currently provided as a preview only. +The "macos-latest" YAML workflow label still uses the MacOS 10.15 virtual environment. +``` ***Looking for other Linux distributions?*** We do not plan to offer other Linux distributions. We recommend using Docker if you'd like to build using other distributions with the hosted virtual environments. Alternatively, you can leverage [self-hosted runners] and fully customize your environment to your needs. @@ -56,4 +61,5 @@ Low Impact changes will be pinned in this repository and marked with the [Announ [Windows-2019]: https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md [windows-2016]: https://github.com/actions/virtual-environments/blob/main/images/win/Windows2016-Readme.md [macOS-10.15]: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md +[macOS-11.0]: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11.0-Readme.md [self-hosted runners]: https://help.github.com/en/actions/hosting-your-own-runners From bf20204c08036df03afd6b34548de6af1c922ba8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2020 09:48:48 +0000 Subject: [PATCH 47/52] Updating readme file for macOS-11.0 version 20201024.1 (#1902) Co-authored-by: Image generation service account Co-authored-by: Actions service account --- images/macos/macos-11.0-Readme.md | 44 ++++++++++++------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/images/macos/macos-11.0-Readme.md b/images/macos/macos-11.0-Readme.md index b4776beb0..75189112d 100644 --- a/images/macos/macos-11.0-Readme.md +++ b/images/macos/macos-11.0-Readme.md @@ -1,6 +1,6 @@ | Announcements | |-| -| [[macOS] Built-in Python 2.7 will be used on macOS instead of Homebrew formula on November, 3rd.](https://github.com/actions/virtual-environments/issues/1848) | +| [.NET 5.0 will become a default .NET version on November, 10](https://github.com/actions/virtual-environments/issues/1891) | | [macOS 11.0 (Big Sur) is available as a preview 🚀](https://github.com/actions/virtual-environments/issues/1814) | | [[macOS] Default Ruby version will be changed to 2.7 on October, 26](https://github.com/actions/virtual-environments/issues/1775) | | [Default Xcode will be changed to Xcode 12.0.1 on October, 20](https://github.com/actions/virtual-environments/issues/1712) | @@ -9,7 +9,7 @@ # macOS 11.0 info - System Version: macOS 11.0 (20A5395g) - Kernel Version: Darwin 20.1.0 -- Image Version: 20201020.1 +- Image Version: 20201024.1 ## Installed Software ### Language and Runtime @@ -34,14 +34,14 @@ - Pip 20.2.3 (python 3.8) - Bundler version 2.1.4 - Carthage 0.36.0 -- CocoaPods 1.9.3 +- CocoaPods 1.10.0 - Homebrew 2.5.6 - NPM 6.14.8 - Yarn 1.22.5 - NuGet 5.6.0.6489 - Miniconda 4.8.3 - RubyGems 3.1.4 -- Composer 1.10.15 +- Composer 2.0.1 ### Project Management - Apache Maven 3.6.3 @@ -50,7 +50,7 @@ ### Utilities - Curl 7.73.0 -- Git: 2.29.0 +- Git: 2.29.1 - Git LFS: 2.12.0 - GitHub CLI: 1.1.0 - Hub CLI: 2.14.2 @@ -63,10 +63,10 @@ - psql (PostgreSQL) 13.0 - PostgreSQL 13.0 - aria2 1.35.0 -- azcopy 10.6.0 +- azcopy 10.6.1 - zstd 1.4.5 - bazel 3.7.0 -- bazelisk 1.7.3 +- bazelisk 1.7.4 - helm v3.3.4+ga61ce56 - mongo v4.4.1 - mongod v4.4.1 @@ -74,13 +74,13 @@ - Newman 5.2.0 ### Tools -- Fastlane 2.164.0 +- Fastlane 2.165.0 - Cmake 3.18.4 - App Center CLI 2.7.2 - Azure CLI 2.13.0 -- AWS CLI 2.0.57 +- AWS CLI 2.0.59 - AWS SAM CLI 1.6.2 -- AWS Session Manager CLI 1.1.61.0 +- AWS Session Manager CLI 1.2.7.0 - Aliyun CLI 3.0.60 - GHCup v0.1.11 - GHC 8.10.2 @@ -94,24 +94,24 @@ ### Browsers - Safari 14.0.1 (16610.2.8.1.1) - SafariDriver 14.0.1 (16610.2.8.1.1) -- Google Chrome 86.0.4240.80 +- Google Chrome 86.0.4240.111 - ChromeDriver 86.0.4240.22 - Microsoft Edge 85.0.564.70 - MSEdgeDriver 85.0.564.70 -- Mozilla Firefox 81.0.2 +- Mozilla Firefox 82.0 - geckodriver 0.27.0 ### Java | Version | Vendor | Environment Variable | | --------- | ------------ | -------------------- | -| 1.8.0_265 | AdoptOpenJDK | JAVA_HOME_8_X64 | -| 11.0.8 | AdoptOpenJDK | JAVA_HOME_11_X64 | +| 1.8.0_272 | AdoptOpenJDK | JAVA_HOME_8_X64 | +| 11.0.9 | AdoptOpenJDK | JAVA_HOME_11_X64 | ### Cached Tools #### Ruby - 2.4.10 - 2.5.8 - 2.6.6 -- 2.7.1 +- 2.7.2 #### Python - 3.7.9 @@ -170,7 +170,6 @@ | Version | Build | Path | | -------------- | -------- | ---------------------------- | | 12.2 (beta) | 12B5035g | /Applications/Xcode_12.2.app | -| 12.1 | 12A7403 | /Applications/Xcode_12.1.app | | 11.7 (default) | 11E801a | /Applications/Xcode_11.7.app | #### Xcode Support Tools @@ -180,40 +179,31 @@ #### Installed SDKs | SDK | SDK Name | Xcode Version | | ----------------------- | -------------------- | ------------- | -| macOS 10.15 | macosx10.15 | 11.7, 12.1 | +| macOS 10.15 | macosx10.15 | 11.7 | | macOS 11.0 | macosx11.0 | 12.2 | | iOS 13.7 | iphoneos13.7 | 11.7 | -| iOS 14.1 | iphoneos14.1 | 12.1 | | iOS 14.2 | iphoneos14.2 | 12.2 | | Simulator - iOS 13.7 | iphonesimulator13.7 | 11.7 | -| Simulator - iOS 14.1 | iphonesimulator14.1 | 12.1 | | Simulator - iOS 14.2 | iphonesimulator14.2 | 12.2 | | tvOS 13.4 | appletvos13.4 | 11.7 | -| tvOS 14.0 | appletvos14.0 | 12.1 | | tvOS 14.2 | appletvos14.2 | 12.2 | | Simulator - tvOS 13.4 | appletvsimulator13.4 | 11.7 | -| Simulator - tvOS 14.0 | appletvsimulator14.0 | 12.1 | | Simulator - tvOS 14.2 | appletvsimulator14.2 | 12.2 | | watchOS 6.2 | watchos6.2 | 11.7 | -| watchOS 7.0 | watchos7.0 | 12.1 | | watchOS 7.1 | watchos7.1 | 12.2 | | Simulator - watchOS 6.2 | watchsimulator6.2 | 11.7 | -| Simulator - watchOS 7.0 | watchsimulator7.0 | 12.1 | | Simulator - watchOS 7.1 | watchsimulator7.1 | 12.2 | -| DriverKit 19.0 | driverkit.macosx19.0 | 11.7, 12.1 | +| DriverKit 19.0 | driverkit.macosx19.0 | 11.7 | | DriverKit 20.0 | driverkit.macosx20.0 | 12.2 | #### Installed Simulators | OS | Xcode Version | Simulators | | ----------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 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.1 | 12.1 | iPod touch (7th generation)
iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 12
iPhone 12 mini
iPhone 12 Pro
iPhone 12 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) | | iOS 14.2 | 12.2 | iPod touch (7th generation)
iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 12
iPhone 12 mini
iPhone 12 Pro
iPhone 12 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 13.4 | 11.7 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | -| tvOS 14.0 | 12.1 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | tvOS 14.2 | 12.2 | Apple TV
Apple TV 4K
Apple TV 4K (at 1080p) | | watchOS 6.2 | 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.1 | 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 | | watchOS 7.1 | 12.2 | 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 From b6e1216543414017858fd7aa91cf4272db8bdd75 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev <50947177+Darleev@users.noreply.github.com> Date: Tue, 27 Oct 2020 17:16:55 +0700 Subject: [PATCH 48/52] [ubuntu] Disable automatic updates to avoid apt lock issue. (#1761) * added shutdown-apt-service.sh script * added logging * added new status * shutdown service check * removed apy.daily from apt.sh * Another way to disable automatic updates; * fix deployment files. * enable retry logic for apt * add PowerShellGet installation before az modules * fixed a comment Co-authored-by: Leonid Lapshin --- images/linux/scripts/base/apt.sh | 12 +++++++++++- images/linux/scripts/installers/azpowershell.sh | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/base/apt.sh b/images/linux/scripts/base/apt.sh index 8afcbe8d2..ff1a9271b 100644 --- a/images/linux/scripts/base/apt.sh +++ b/images/linux/scripts/base/apt.sh @@ -3,11 +3,21 @@ export DEBIAN_FRONTEND=noninteractive apt-get -yq update apt-get -yq dist-upgrade -systemctl disable apt-daily.service + +# Stop and disable apt-daily upgrade services; +systemctl stop apt-daily.timer systemctl disable apt-daily.timer +systemctl disable apt-daily.service +systemctl stop apt-daily-upgrade.timer systemctl disable apt-daily-upgrade.timer systemctl disable apt-daily-upgrade.service +# This step should completely disable any automatic updates except manual +sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades + +# Enable retry logic for apt up to 10 times +echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries + # Configure apt to always assume Y echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes diff --git a/images/linux/scripts/installers/azpowershell.sh b/images/linux/scripts/installers/azpowershell.sh index a8488af7f..47ac5ff3e 100644 --- a/images/linux/scripts/installers/azpowershell.sh +++ b/images/linux/scripts/installers/azpowershell.sh @@ -15,9 +15,13 @@ else versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset) fi +# Try to install and update PowerShellGet before the actual installation +pwsh -Command "Install-Module -Name PowerShellGet -Force" +pwsh -Command "Update-Module -Name PowerShellGet -Force" + # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) for version in ${versions[@]}; do - pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force" + pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force -Verbose" done # Run tests to determine that the software installed as expected From 75112c44494939066cc3b793aa3bb99f2cde4335 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:24:59 +0300 Subject: [PATCH 49/52] clean yarn and npm cache --- images/linux/scripts/installers/post-deployment.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/images/linux/scripts/installers/post-deployment.sh b/images/linux/scripts/installers/post-deployment.sh index 95a2e2fa9..d427a172e 100644 --- a/images/linux/scripts/installers/post-deployment.sh +++ b/images/linux/scripts/installers/post-deployment.sh @@ -24,3 +24,7 @@ then echo "PATH = $PATH" exit 1 fi + +# Clean yarn and npm cache +yarn cache clean +npm cache clean --force \ No newline at end of file From 6a7cc6229f259b3eed5c6d7ba0572bec4d2ba71f Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:54:16 +0300 Subject: [PATCH 50/52] clean yarn cache --- images/macos/provision/configuration/finalize-vm.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index b69751398..c08da558a 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -20,5 +20,8 @@ cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-gene # we have to do that here because `npm install` is run in a few different places during image-generation npm cache clean --force +# Clean yarn cache +yarn cache clean + # Clean up temporary directories -rm -rf ~/utils ~/image-generation \ No newline at end of file +rm -rf ~/utils ~/image-generation From 4e5143b7328a848bc29826d611666d6253741062 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 27 Oct 2020 17:56:52 +0300 Subject: [PATCH 51/52] delete extra line --- images/macos/provision/configuration/finalize-vm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index c08da558a..b7cef4db4 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -24,4 +24,4 @@ npm cache clean --force yarn cache clean # Clean up temporary directories -rm -rf ~/utils ~/image-generation +rm -rf ~/utils ~/image-generation \ No newline at end of file From 2ccffebdba2abdec17496035a26da07ad962bd9c Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 27 Oct 2020 18:52:40 +0300 Subject: [PATCH 52/52] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99086a724..9456f0bc0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For general questions about using the virtual environments or writing your Actio | Ubuntu 18.04 | `ubuntu-latest` or `ubuntu-18.04` | [ubuntu-18.04] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu18&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu18&redirect=1) | Ubuntu 16.04 | `ubuntu-16.04` | [ubuntu-16.04] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu16&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=ubuntu16&redirect=1) | | macOS 11.0 | `macos-11.0` | [macOS-11.0] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-11.0&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-11.0&redirect=1) -| macOS 10.15 | `macos-latest` or `macos-10.15` | [macOS-10.15] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macOS-10.15&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macOS-10.15&redirect=1) +| macOS 10.15 | `macos-latest` or `macos-10.15` | [macOS-10.15] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-10.15&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=macos-10.15&redirect=1) | Windows Server 2019 | `windows-latest` or `windows-2019` | [windows-2019] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2019&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2019&redirect=1) | Windows Server 2016 | `windows-2016` | [windows-2016] | [![](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2016&badge=1)](https://actionvirtualenvironmentsstatus.azurewebsites.net/api/status?imageName=windows-2016&redirect=1) ```