feat: add support for Ubuntu Focal 20.04 (#1168)

Co-authored-by: Valerio Bozzolan <gnu@linux.it>
This commit is contained in:
Kyle Robbertze 2021-11-04 07:55:50 +00:00 committed by GitHub
parent 3d20af5fae
commit 7182390000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 73 additions and 41 deletions

View File

@ -62,7 +62,7 @@ jobs:
include: include:
- runs-on: ubuntu-18.04 - runs-on: ubuntu-18.04
php-version: "7.2" php-version: "7.2"
- runs-on: ubuntu-latest - runs-on: ubuntu-20.04
php-version: "7.4" php-version: "7.4"
runs-on: ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }}
@ -146,8 +146,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
context: [analyzer, api_client] context: [analyzer, api_client]
release: [bionic, buster] release: [bionic, buster, focal]
container: ghcr.io/libretime/libretime-dev:${{ matrix.release }} container: ghcr.io/libretime/libretime-dev:${{ matrix.release }}
defaults: defaults:
run: run:

5
Vagrantfile vendored
View File

@ -85,6 +85,11 @@ Vagrant.configure('2') do |config|
end end
# Define all the OS boxes we support # Define all the OS boxes we support
config.vm.define "ubuntu-focal" do |os|
os.vm.box = "bento/ubuntu-20.04"
provision_libretime(os, "debian.sh", installer_args)
end
config.vm.define 'ubuntu-bionic' do |os| config.vm.define 'ubuntu-bionic' do |os|
os.vm.box = 'bento/ubuntu-18.04' os.vm.box = 'bento/ubuntu-18.04'
setup_nfs(config) setup_nfs(config)

View File

@ -19,8 +19,8 @@ def test_analyze(filepath, length, cuein, cueout):
if filepath.endswith("m4a"): if filepath.endswith("m4a"):
return return
# Silan does not work with mp3 on debian buster # Silan does not work with mp3 on debian buster or Ubuntu Focal
if filepath.endswith("mp3") and "buster" == distro.codename(): if filepath.endswith("mp3") and distro.codename() in ("buster", "focal"):
return return
assert float(metadata["cuein"]) == pytest.approx(cuein, abs=0.5) assert float(metadata["cuein"]) == pytest.approx(cuein, abs=0.5)

View File

@ -30,8 +30,8 @@ def test_analyze_invalid_filepath():
def test_analyze_invalid_wma(): def test_analyze_invalid_wma():
# Liquisoap does not fail with wma files on debian buster # Liquisoap does not fail with wma files on debian buster or Ubuntu Focal
if "buster" == distro.codename(): if distro.codename() in ("buster", "focal"):
return return
with pytest.raises(UnplayableFileError): with pytest.raises(UnplayableFileError):

View File

@ -1,14 +1,14 @@
# This file contains a list of package dependencies. # This file contains a list of package dependencies.
[common] [common]
python3 = buster, bionic python3 = buster, bionic, focal
python3-pip = buster, bionic python3-pip = buster, bionic, focal
python3-venv = buster, bionic python3-venv = buster, bionic, focal
[django] [django]
uwsgi = buster, bionic uwsgi = buster, bionic, focal
uwsgi-plugin-python3 = buster, bionic uwsgi-plugin-python3 = buster, bionic, focal
[psycopg2] [psycopg2]
# See https://www.psycopg.org/docs/install.html#install-from-source # See https://www.psycopg.org/docs/install.html#install-from-source
python3-dev = buster, bionic python3-dev = buster, bionic, focal
libpq-dev = buster, bionic libpq-dev = buster, bionic, focal

View File

@ -94,6 +94,7 @@ offers the option to choose a different operation system according to you needs.
| OS | Command | Comment | | OS | Command | Comment |
| ------------ | -------------------------- | ----------------------------------------------------------- | | ------------ | -------------------------- | ----------------------------------------------------------- |
| Debian 10 | `vagrant up debian-buster` | Install on Debian Buster. | | Debian 10 | `vagrant up debian-buster` | Install on Debian Buster. |
| Ubuntu 20.04 | `vagrant up ubuntu-focal` | Install on Ubuntu Focal Fossa. |
| Ubuntu 18.04 | `vagrant up ubuntu-bionic` | Install on Ubuntu Bionic Beaver. | | Ubuntu 18.04 | `vagrant up ubuntu-bionic` | Install on Ubuntu Bionic Beaver. |
| CentOS | `vagrant up centos` | CentOS 8 with native systemd support and activated SELinux. | | CentOS | `vagrant up centos` | CentOS 8 with native systemd support and activated SELinux. |

15
install
View File

@ -648,6 +648,7 @@ fi
is_debian_dist=false is_debian_dist=false
is_debian_buster=false is_debian_buster=false
is_ubuntu_dist=false is_ubuntu_dist=false
is_ubuntu_focal=false
is_ubuntu_bionic=false is_ubuntu_bionic=false
is_centos_dist=false is_centos_dist=false
# shellcheck disable=SC2034 # shellcheck disable=SC2034
@ -659,6 +660,11 @@ code="${code:-$VERSION_ID}"
code="${code,,}" code="${code,,}"
verbose "Validating dist-code: ${dist}-${code}" verbose "Validating dist-code: ${dist}-${code}"
case "${dist}-${code}" in case "${dist}-${code}" in
ubuntu-20.04)
code="focal"
is_ubuntu_dist=true
is_ubuntu_focal=true
;;
ubuntu-18.04) ubuntu-18.04)
code="bionic" code="bionic"
is_ubuntu_dist=true is_ubuntu_dist=true
@ -1075,6 +1081,7 @@ loud " * Configuring PHP in Apache * "
loud "-----------------------------------------------------" loud "-----------------------------------------------------"
# Test common locations for php conf directory # Test common locations for php conf directory
php_conf_dirs=( php_conf_dirs=(
"/etc/php/7.4/apache2/conf.d" # Ubuntu Focal
"/etc/php/7.3/apache2/conf.d" # Debian Buster "/etc/php/7.3/apache2/conf.d" # Debian Buster
"/etc/php/7.2/apache2/conf.d" # Ubuntu Bionic "/etc/php/7.2/apache2/conf.d" # Ubuntu Bionic
"/etc/php/7.0/apache2/conf.d" # Ubuntu Xenial "/etc/php/7.0/apache2/conf.d" # Ubuntu Xenial
@ -1099,7 +1106,9 @@ else
fi fi
# Enable Apache modules # Enable Apache modules
if $is_debian_buster; then if $is_ubuntu_focal; then
loudCmd "a2enmod rewrite php7.4 proxy proxy_http"
elif $is_debian_buster; then
loudCmd "a2enmod rewrite php7.3 proxy proxy_http" loudCmd "a2enmod rewrite php7.3 proxy proxy_http"
elif $is_ubuntu_bionic; then elif $is_ubuntu_bionic; then
loudCmd "a2enmod rewrite php7.2 proxy proxy_http" loudCmd "a2enmod rewrite php7.2 proxy proxy_http"
@ -1260,7 +1269,7 @@ verbose "...Done"
echo -e "\n-----------------------------------------------------" echo -e "\n-----------------------------------------------------"
echo " * Basic Setup DONE! * " echo " * Basic Setup DONE! * "
echo " " echo " "
echo " To get started with Libretime, visit ${IP} " echo " To get started with Libretime, visit ${IP} "
echo " or, if you've set up your own web configuration, " echo " or, if you've set up your own web configuration, "
echo " the Libretime webroot on your webserver " echo " the Libretime webroot on your webserver "
echo "-----------------------------------------------------" echo "-----------------------------------------------------"

View File

@ -1,10 +1,10 @@
# This file contains a list of package dependencies. # This file contains a list of package dependencies.
[common] [common]
apache2 = buster, bionic apache2 = buster, bionic, focal
# The php-pear package depends on php-(cli|common|xml), be sure to # The php-pear package depends on php-(cli|common|xml), be sure to
# install the dependencies with the right php version. # install the dependencies with the right php version.
php-pear = buster, bionic php-pear = buster, bionic, focal
php-amqplib = buster, bionic php-amqplib = buster, bionic, focal
# Bionic # Bionic
[php7.2] [php7.2]
@ -38,3 +38,19 @@ php7.3-gd = buster
php7.3-mbstring = buster php7.3-mbstring = buster
php7.3-pgsql = buster php7.3-pgsql = buster
php7.3-xml = buster php7.3-xml = buster
# Focal
[php7.4]
libapache2-mod-php7.4 = focal
php7.4 = focal
php7.4-apcu = focal
php7.4-apcu-bc = focal
php7.4-bcmath = focal
php7.4-cli = focal
php7.4-common = focal
php7.4-curl = focal
php7.4-dev = focal
php7.4-gd = focal
php7.4-mbstring = focal
php7.4-pgsql = focal
php7.4-xml = buster, focal

View File

@ -1,16 +1,16 @@
# This file contains a list of package dependencies. # This file contains a list of package dependencies.
[common] [common]
icecast2 = buster, bionic icecast2 = buster, bionic, focal
postgresql = buster, bionic postgresql = buster, bionic, focal
postgresql-client = buster, bionic postgresql-client = buster, bionic, focal
rabbitmq-server = buster, bionic rabbitmq-server = buster, bionic, focal
curl = buster, bionic curl = buster, bionic, focal
# See https://github.com/Libretime/libretime/commits/71ce3082c5e0611f77eb423a15b4b36267ebfda4/installer/lib # See https://github.com/Libretime/libretime/commits/71ce3082c5e0611f77eb423a15b4b36267ebfda4/installer/lib
unzip = buster, bionic unzip = buster, bionic, focal
zip = buster, bionic zip = buster, bionic, focal
[installer] [installer]
lsb-release = buster, bionic lsb-release = buster, bionic, focal
xmlstarlet = buster, bionic xmlstarlet = buster, bionic, focal

View File

@ -27,7 +27,7 @@ def run():
generate_liquidsoap_cfg.run() generate_liquidsoap_cfg.run()
""" check liquidsoap version so we can run a scripts matching the liquidsoap minor version """ """ check liquidsoap version so we can run a scripts matching the liquidsoap minor version """
liquidsoap_version = subprocess.check_output( liquidsoap_version = subprocess.check_output(
"liquidsoap --force-start 'print(liquidsoap.version) shutdown()'", "liquidsoap 'print(liquidsoap.version) shutdown()'",
shell=True, shell=True,
universal_newlines=True, universal_newlines=True,
)[0:3] )[0:3]
@ -37,9 +37,8 @@ def run():
exec_args = [ exec_args = [
"/usr/bin/liquidsoap", "/usr/bin/liquidsoap",
"libretime-liquidsoap", "libretime-liquidsoap",
script_path,
"--verbose", "--verbose",
"-f", script_path,
] ]
if args.debug: if args.debug:
print(f"Liquidsoap {liquidsoap_version} using script: {script_path}") print(f"Liquidsoap {liquidsoap_version} using script: {script_path}")

View File

@ -4,29 +4,32 @@ from tools.packages import list_packages, load_packages
PACKAGE_INI = """ PACKAGE_INI = """
[common] [common]
postgresql = buster postgresql = buster, focal
# Some comment # Some comment
curl = buster, bionic curl = buster, bionic
[legacy] [legacy]
apache2 = bionic apache2 = bionic, focal
[=development] [=development]
ffmpeg = buster, bionic ffmpeg = buster, bionic, focal
""" """
result1 = {"curl", "postgresql"} result_buster = {"curl", "postgresql"}
result2 = {"apache2", "curl", "ffmpeg"} result_bionic = {"apache2", "curl", "ffmpeg"}
result_focal = {"postgresql", "apache2", "ffmpeg"}
def test_load_packages(): def test_load_packages():
assert load_packages(PACKAGE_INI, "buster", False) == result1 assert load_packages(PACKAGE_INI, "buster", False) == result_buster
assert load_packages(PACKAGE_INI, "bionic", True) == result2 assert load_packages(PACKAGE_INI, "bionic", True) == result_bionic
assert load_packages(PACKAGE_INI, "focal", True) == result_focal
def test_list_packages(tmp_path: Path): def test_list_packages(tmp_path: Path):
package_file = tmp_path / "packages.ini" package_file = tmp_path / "packages.ini"
package_file.write_text(PACKAGE_INI) package_file.write_text(PACKAGE_INI)
assert list_packages([tmp_path, package_file], "buster", False) == result1 assert list_packages([tmp_path, package_file], "buster", False) == result_buster
assert list_packages([tmp_path, package_file], "bionic", True) == result2 assert list_packages([tmp_path, package_file], "bionic", True) == result_bionic
assert list_packages([tmp_path, package_file], "focal", True) == result_focal