-
Notifications
You must be signed in to change notification settings - Fork 33
80 lines (61 loc) · 3.01 KB
/
ant-media-server-docker-multi-platform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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