Skip to content

Commit

Permalink
Merge pull request #320 from ant-media/feature/add-debian-support
Browse files Browse the repository at this point in the history
Add Debian support to installation script
  • Loading branch information
mekya authored Nov 28, 2024
2 parents 32bd936 + 50258f9 commit f9ad7c7
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 8 deletions.
19 changes: 19 additions & 0 deletions .github/actions/deploy-debian-11/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy on Debian 11
runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ant Media Server
shell: bash
run: |
apt-get update
apt-get -y install wget findutils unzip curl
curl -L -o ant-media-server-community.zip $(curl -s https://api.github.com/repos/ant-media/Ant-Media-Server/releases/latest | grep "browser_download_url" | cut -d '"' -f 4)
bash ./install_ant-media-server.sh -i ant-media-server-community.zip -s false
/usr/local/antmedia/antmedia start
sleep 40
if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then
echo "LiveApp started log does not exist. Check the logs above"
exit 1;
fi;
19 changes: 19 additions & 0 deletions .github/actions/deploy-debian-12/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy on Debian 12
runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ant Media Server
shell: bash
run: |
apt-get update
apt-get -y install wget findutils unzip curl
curl -L -o ant-media-server-community.zip $(curl -s https://api.github.com/repos/ant-media/Ant-Media-Server/releases/latest | grep "browser_download_url" | cut -d '"' -f 4)
bash ./install_ant-media-server.sh -i ant-media-server-community.zip -s false
/usr/local/antmedia/antmedia start
sleep 40
if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then
echo "LiveApp started log does not exist. Check the logs above"
exit 1;
fi;
16 changes: 16 additions & 0 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Debian
on: [push]

jobs:
Debian11:
runs-on: ubuntu-24.04
container: debian:11
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy-debian-11
Debian12:
runs-on: ubuntu-24.04
container: debian:12
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy-debian-12
16 changes: 8 additions & 8 deletions install_ant-media-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ distro () {
$SUDO apt-get update && $SUDO apt-get install coreutils
CUSTOM_JVM=$DEFAULT_JAVA
fi
elif [ "$ID" == "ubuntu" ] || [ "$ID" == "centos" ] || [ "$ID" == "rocky" ] || [ "$ID" == "almalinux" ] || [ "$ID" == "rhel" ]; then
elif [ "$ID" == "ubuntu" ] || [ "$ID" == "centos" ] || [ "$ID" == "rocky" ] || [ "$ID" == "almalinux" ] || [ "$ID" == "rhel" ] || [ "$ID" == "debian" ]; then
if [ "$VERSION_ID" == "18.04" ] && [ "aarch64" == $ARCH ]; then
echo -e "ARM architecture is supported on Ubuntu 20.04. For 18.04 installation, use the link below to install.\nhttps://github.com/ant-media/Ant-Media-Server/wiki/Frequently-Asked-Questions#how-can-i-install-the-ant-media-server-on-ubuntu-1804-with-arm64"
exit 1
fi

if [[ $VERSION_ID != 18.04 ]] && [[ $VERSION_ID != 20.04 ]] && [[ $VERSION_ID != 22.04 ]] && [[ $VERSION_ID != 24.04 ]] && [[ $VERSION_ID != 8* ]] && [[ $VERSION_ID != 9* ]]; then
if [[ $VERSION_ID != 18.04 ]] && [[ $VERSION_ID != 20.04 ]] && [[ $VERSION_ID != 22.04 ]] && [[ $VERSION_ID != 24.04 ]] && [[ $VERSION_ID != 8* ]] && [[ $VERSION_ID != 9* ]] && [[ $VERSION_ID != 12 ]] && [[ $VERSION_ID != 11 ]]; then
echo $msg
exit 1
fi
Expand Down Expand Up @@ -262,7 +262,7 @@ if [ "$UPDATE" == "true" ]; then
fi

if [ -z "$ANT_MEDIA_SERVER_ZIP_FILE" ]; then
if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
#Added curl package for the minimal OS installations.
$SUDO apt-get update
$SUDO apt-get install jq curl -y
Expand Down Expand Up @@ -312,7 +312,7 @@ fi

REQUIRED_VERSION="2.6"

if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
$SUDO apt-get update -y
$SUDO apt-get install unzip zip libva-drm2 libva-x11-2 libvdpau-dev -y
$SUDO unzip -o $ANT_MEDIA_SERVER_ZIP_FILE "ant-media-server/ant-media-server.jar" -d /tmp/
Expand Down Expand Up @@ -359,7 +359,7 @@ check


if [[ $VERSION == 2.1\.+.* || $VERSION == 2.0* || $VERSION == 1.* ]]; then
if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
$SUDO apt-get install openjdk-8-jre -y
$SUDO apt purge openjfx libopenjfx-java libopenjfx-jni -y
$SUDO apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 -y
Expand All @@ -377,14 +377,14 @@ if [[ $VERSION == 2.1\.+.* || $VERSION == 2.0* || $VERSION == 1.* ]]; then

elif [[ $VERSION == 2.4* || $VERSION == 2.3* || $VERSION == 2.2* ]]; then

if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
$SUDO apt-get update -y
$SUDO apt-get install openjdk-11-jdk -y
check
fi

elif [[ $VERSION == 2.5* || $VERSION == 2.6* || $VERSION == 2.7* ]]; then
if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
$SUDO apt-get update -y
$SUDO apt-get install openjdk-11-jre-headless -y
check
Expand All @@ -400,7 +400,7 @@ elif [[ $VERSION == 2.5* || $VERSION == 2.6* || $VERSION == 2.7* ]]; then

else
# with 2.8 we start to use java17
if [ "$ID" == "ubuntu" ]; then
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]]; then
$SUDO apt-get update -y
$SUDO apt-get install openjdk-17-jre-headless -y
check
Expand Down

0 comments on commit f9ad7c7

Please sign in to comment.