Skip to content

Commit

Permalink
Merge branch 'master' into add_terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
muratugureminoglu authored Dec 18, 2024
2 parents 1cd1856 + c71d8f2 commit e76d66d
Show file tree
Hide file tree
Showing 47 changed files with 1,441 additions and 164 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;
8 changes: 1 addition & 7 deletions .github/workflows/almalinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ name: AlmaLinux
on: [push]

jobs:
Almalinux8:
runs-on: ubuntu-20.04
container: almalinux:8
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy-almalinux
Almalinux9:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
container: almalinux:9
steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ams-utilizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ jobs:
- name: Set up MongoDB
run: |
bash ./install_mongodb.sh
mongodb_install_ubuntu_24_04:
runs-on: ubuntu-24.04

steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up MongoDB
run: |
bash ./install_mongodb.sh
16 changes: 12 additions & 4 deletions .github/workflows/ant-media-server-docker-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [push]
jobs:
ams_ubuntu_docker_test:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -13,10 +15,10 @@ jobs:
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
run: wget --quiet https://raw.githubusercontent.com/ant-media/Scripts/$BRANCH_NAME/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 .
run: docker build --network=host -t antmediaserver:latest --build-arg AntMediaServer=ant-media-server-community.zip --build-arg BranchName=$BRANCH_NAME .

- name: Run the image
run: docker run -d -p 5080:5080 --name antmediaserver antmediaserver
Expand All @@ -43,6 +45,8 @@ jobs:

ams_rockylinux_docker_test:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -51,10 +55,14 @@ jobs:
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
run: |
echo "Building Docker image with branch: $BRANCH_NAME"
wget --quiet https://raw.githubusercontent.com/ant-media/Scripts/$BRANCH_NAME/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 .
run: |
echo "Building Docker image with branch: $BRANCH_NAME"
docker build --network=host -t antmediaserver:latest --build-arg AntMediaServer=ant-media-server-community.zip --build-arg BranchName=$BRANCH_NAME .
- name: Run the image
run: docker run -d -p 5080:5080 --name antmediaserver antmediaserver
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/centos.yml

This file was deleted.

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
72 changes: 72 additions & 0 deletions .github/workflows/install-dockerfile-and-check-ssl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Docker Build and Test

on:
# [push]
workflow_dispatch:
schedule:
- cron: '0 0 */5 * *'

jobs:
build:
runs-on: self-hosted

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Show current branch
run: echo "Current branch is ${{ github.event.inputs.branch_name }}"

- name: stop the AMS service
run: sudo systemctl stop antmedia

- name: Run Docker service
run: sudo systemctl restart docker

- name: Build Docker image
run: docker build -f docker/Dockerfile_Process --network=host -t antmediaserver --build-arg LicenseKey="${{ secrets.ENTERPRISE_LICENSE }}" .

- name: Run Docker container
run: docker run --restart=always -d --name antmedia --network=host -it antmediaserver

- name: Check if SSL is enabled or not
run: |
set -e
if docker exec antmedia curl -f https://${{ secrets.CI_SSL_TEST_DOMAIN }}:5443; then
echo "Endpoint is reachable."
exit 1
else
echo "Endpoint is not reachable, but continuing workflow."
fi
# - name: Clone branch
# run: |
# git clone --depth=1 -b ${{ github.event.inputs.branch_name }} https://github.com/ant-media/Ant-Media-Server.git || git clone --depth=1 https://github.com/ant-media/Ant-Media-Server.git

- name: Download enable_ssl.sh inside container
run: docker exec antmedia wget -O /usr/local/antmedia/enable_ssl.sh https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/enable_ssl.sh

# - name: Copy enable_ssl.sh from cloned branch to container
# run: docker cp Ant-Media-Server/src/main/server/enable_ssl.sh antmedia:/usr/local/antmedia/enable_ssl.sh

- name: Run enable_ssl.sh inside container
run: docker exec antmedia bash /usr/local/antmedia/enable_ssl.sh -d ${{ secrets.CI_SSL_TEST_DOMAIN }}

- name: Verify container is running
run: |
sleep 20
docker ps -f name=antmedia
if [ $(docker ps -f name=antmedia --format '{{.Names}}') != "antmedia" ]; then
echo "Container is not running"
exit 1
fi
- name: Test application
run: |
docker exec antmedia curl -f https://${{ secrets.CI_SSL_TEST_DOMAIN }}:5443
- name: Stop and remove container
if: ${{ always() }}
run: |
docker stop antmedia
docker rm antmedia
sudo systemctl start antmedia
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- run: wget -O maven-metadata.xml https://oss.sonatype.org/service/local/repositories/snapshots/content/io/antmedia/ant-media-server/maven-metadata.xml
#Get latest snapshot
- run: |
export LATEST_SNAPSHOT=$(cat maven-metadata.xml | grep "<version>" | tail -n 1 | xargs | cut -c 10-23)
export LATEST_SNAPSHOT=$(grep -oP '(?<=<version>)[^<]+' maven-metadata.xml| tail -1)
echo $LATEST_SNAPSHOT
wget -O ant-media-server-community.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=io.antmedia&a=ant-media-server&v=${LATEST_SNAPSHOT}&c=community&e=zip";
- run: ./install_ant-media-server.sh -i ant-media-server-community.zip
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Install Latest Snapshot to Ubuntu 24.04
on: [push]

jobs:
Install-Ubuntu-24-04:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."

- run: wget -O maven-metadata.xml https://oss.sonatype.org/service/local/repositories/snapshots/content/io/antmedia/ant-media-server/maven-metadata.xml
#Get latest snapshot
- run: |
export LATEST_SNAPSHOT=$(grep -oP '(?<=<version>)[^<]+' maven-metadata.xml| tail -1)
echo $LATEST_SNAPSHOT
wget -O ant-media-server-community.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=io.antmedia&a=ant-media-server&v=${LATEST_SNAPSHOT}&c=community&e=zip";
- run: ./install_ant-media-server.sh -i ant-media-server-community.zip
- run: sudo service antmedia status
- run: sleep 30
- run: cat /usr/local/antmedia/log/ant-media-server.log
- run: |
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;
- run: cat /usr/local/antmedia/log/antmedia-error.log
53 changes: 53 additions & 0 deletions .github/workflows/install-latest-to-ubuntu-24-04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Install Latest to Ubuntu 24.04
on: [push]

jobs:
Install-Ubuntu-24-04:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
#Get latest version
- 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)
- run: ./install_ant-media-server.sh -i ant-media-server-community.zip
- run: sleep 30
- run: cat /usr/local/antmedia/log/ant-media-server.log
- run: |
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;
- run: cat /usr/local/antmedia/log/antmedia-error.log
Auto-Install-Community-:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
#Get latest version
- run: ./install_ant-media-server.sh
- run: sleep 30
- run: cat /usr/local/antmedia/log/ant-media-server.log
- run: |
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;
- run: cat /usr/local/antmedia/log/antmedia-error.log
Auto-Install-Enterprise-:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
#Get latest version
- run: bash -x ./install_ant-media-server.sh -l"${{ secrets.ENTERPRISE_LICENSE }}"
- run: sleep 30
- run: cat /usr/local/antmedia/log/ant-media-server.log
- run: |
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;
- run: cat /usr/local/antmedia/log/antmedia-error.log
10 changes: 2 additions & 8 deletions .github/workflows/rockylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ name: RockyLinux
on: [push]

jobs:
RockyLinux8:
runs-on: ubuntu-20.04
container: rockylinux:8
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy-rockylinux
RockyLinux9:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
container: rockylinux:9
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/deploy-rockylinux-9
- uses: ./.github/actions/deploy-rockylinux-9
68 changes: 68 additions & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Python Samples Script

on:
schedule:
- cron: '0 */12 * * *'

jobs:
run-selenium:
runs-on: ubuntu-latest

env:
WEBHOOK_URL: ${{ secrets.WEBHOOK }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: |
pip install selenium
pip install requests
- name: Install FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install SRT
run: |
git clone https://github.com/Haivision/srt.git
cd srt
sudo apt-get install tclsh pkg-config cmake libssl-dev build-essential
./configure
make
sudo make install
cd ..
- name: Install Chrome
run: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
- name: Install ChromeDriver
run: |
wget https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.69/linux64/chromedriver-linux64.zip
unzip chromedriver-linux64.zip
cd chromedriver-linux64
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
- name: Run Selenium script
run: |
python Selenium/antmedia-samples.py
- name: Install jq
run: sudo apt-get install -y jq

- name: Send Slack notification on failure
if: ${{ failure() || cancelled() }}
run: |
SLACK_PAYLOAD=$(jq -n --arg text "<@U01UMD36SQ0> GitHub Workflow failed for ${{ github.repository }}" '{text: $text, icon_emoji: ":x:"}')
curl -X POST -H 'Content-type: application/json' --data "$SLACK_PAYLOAD" ${{ env.WEBHOOK_URL }}
Loading

0 comments on commit e76d66d

Please sign in to comment.