Improve choco stability by adding retry logic on Windows images (#721)

Add retry logic for choco install to avoid random failures
This commit is contained in:
Aleksandr Chebotov
2020-04-17 10:53:30 +03:00
committed by GitHub
parent d4435d6a11
commit edce722a68
33 changed files with 57 additions and 59 deletions

View File

@@ -8,10 +8,10 @@ Import-Module -Name ImageHelpers
# Install latest PHP in chocolatey
$installDir = "c:\tools\php"
choco install php -y --force --params "/InstallDir:$installDir"
Choco-Install -PackageName php -ArgumentList "--force", "--params", "/InstallDir:$installDir"
# Install latest Composer in chocolatey
choco install composer --ia "/DEV=$installDir /PHP=$installDir"
Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir"
# update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions.
((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace 'extension=";php_openssl.dll"','extension_dir = "php_openssl.dll"') | Set-Content -Path $installDir\php.ini