Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework php installation #3272

Merged
merged 5 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ function Get-SbtVersion {

function Get-PHPVersions {
$result = Get-CommandResult "apt list --installed" -Multiline
return $result.Output | Where-Object { $_ -match "^php\d+\.\d+/"} | ForEach-Object {
$aptSourceRepo = Get-AptSourceRepository -PackageName "php"
$versionsList = $result.Output | Where-Object { $_ -match "^php\d+\.\d+/"} | ForEach-Object {
$_ -match "now (?<version>\d+\.\d+\.\d+)-" | Out-Null
$Matches.version
}
$Matches.version }
return $versionsList + "(apt source repository: $aptSourceRepo)"
}

function Get-ComposerVersion {
Expand Down
14 changes: 7 additions & 7 deletions images/linux/scripts/installers/php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ source $HELPER_SCRIPTS/os.sh
source $HELPER_SCRIPTS/install.sh

# add repository
apt-add-repository ppa:ondrej/php -y
REPO_URL="ppa:ondrej/php"
apt-add-repository $REPO_URL -y
apt-get update

# Install PHP
Expand Down Expand Up @@ -98,11 +99,10 @@ wget -q -O phpunit https://phar.phpunit.de/phpunit-8.phar
chmod +x phpunit
mv phpunit /usr/local/bin/phpunit

# ubuntu 20.04 libzip-dev is libzip5 based and is not compatible libzip-dev of ppa:ondrej/php
# see https://github.com/actions/virtual-environments/issues/1084
if isUbuntu20 ; then
rm /etc/apt/sources.list.d/ondrej-ubuntu-php-focal.list
apt-get update
fi
# remove repository after successfull installation
rm -r /etc/apt/sources.list.d/ondrej-ubuntu-php-*

echo "php $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
apt-get update

invoke_tests "Common" "PHP"