mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 21:13:04 +07:00
Add support for self-hosted debian runner
This commit is contained in:
parent
8ace7bdc6e
commit
91bd11146c
@ -7,7 +7,7 @@ self_hosted_helper() {
|
|||||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||||
fi
|
fi
|
||||||
install_packages apt-transport-https curl make software-properties-common unzip autoconf automake gcc g++
|
install_packages apt-transport-https ca-certificates curl make software-properties-common unzip autoconf automake gcc g++ gnupg
|
||||||
add_ppa ondrej/php
|
add_ppa ondrej/php
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,10 +25,16 @@ cleanup_lists() {
|
|||||||
# Function to add ppa:ondrej/php.
|
# Function to add ppa:ondrej/php.
|
||||||
add_ppa() {
|
add_ppa() {
|
||||||
ppa=${1:-ondrej/php}
|
ppa=${1:-ondrej/php}
|
||||||
if ! apt-cache policy | grep -q "$ppa"; then
|
if [ "$ID" = "debian" ] && [ "$ppa" = "ondrej/php" ]; then
|
||||||
|
get -q -n /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||||
|
echo "deb https://packages.sury.org/php/ $VERSION_CODENAME main" > /etc/apt/sources.list.d/ondrej.list
|
||||||
|
elif ! apt-cache policy | grep -q "$ppa"; then
|
||||||
cleanup_lists "$(dirname "$ppa")"
|
cleanup_lists "$(dirname "$ppa")"
|
||||||
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:"$ppa" -y
|
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:"$ppa" -y
|
||||||
fi
|
fi
|
||||||
|
if [ "$ID" = "debian" ]; then
|
||||||
|
sudo "$debconf_fix" apt-get update
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to update the package lists.
|
# Function to update the package lists.
|
||||||
|
Loading…
Reference in New Issue
Block a user