Skip to content

Add test for Debian 11 and Debian 12 #256

Add test for Debian 11 and Debian 12

Add test for Debian 11 and Debian 12 #256

name: CI/CD for Docker Images - Ant Media Server (Ubuntu & Rocky Linux)
on: [push]
jobs:
ams_ubuntu_docker_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download the latest version of Ant Media Server
run: 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)
- name: Download Dockerfile
run: wget --quiet https://raw.githubusercontent.com/ant-media/Scripts/master/docker/Dockerfile_Process -O Dockerfile
- name: Build Docker image
run: docker build --network=host -t antmediaserver:latest --build-arg AntMediaServer=ant-media-server-community.zip .
- name: Run the image
run: docker run -d -p 5080:5080 --name antmediaserver antmediaserver
- name: Check Ant Media Server health with a timeout
run: |
timeout=120
start_time=$(date +%s)
until wget http://localhost:5080 -O index.html; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -gt $timeout ]; then
echo "Timeout reached. Ant Media Server did not start within $timeout seconds."
exit 1
fi
echo "Waiting for Ant Media Server to start..."
sleep 10
done
- name: Stop and remove the container
run: docker stop antmediaserver && docker rm antmediaserver
ams_rockylinux_docker_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download the latest version of Ant Media Server
run: 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)
- name: Download Dockerfile
run: wget --quiet https://raw.githubusercontent.com/ant-media/Scripts/master/docker/Dockerfile_RockyLinux -O Dockerfile
- name: Build Docker image
run: docker build --network=host -t antmediaserver:latest --build-arg AntMediaServer=ant-media-server-community.zip .
- name: Run the image
run: docker run -d -p 5080:5080 --name antmediaserver antmediaserver
- name: Check Ant Media Server health with a timeout
run: |
timeout=120
start_time=$(date +%s)
until wget http://localhost:5080 -O index.html; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -gt $timeout ]; then
echo "Timeout reached. Ant Media Server did not start within $timeout seconds."
exit 1
fi
echo "Waiting for Ant Media Server to start..."
sleep 10
done
- name: Stop and remove the container
run: docker stop antmediaserver && docker rm antmediaserver