Skip to content

Add mongodb gpg key and repository #5

Add mongodb gpg key and repository

Add mongodb gpg key and repository #5

Workflow file for this run

name: Ant Media Server Community Edition Test
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build-and-test:
runs-on: ubuntu-22.04
env:
GPG_TTY: ${{ secrets.GPG_TTY }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Import GPG key
run: ls
- name: Add MongoDB 6.0 GPG key and repository
run: |
if [ ! -f /usr/share/keyrings/mongodb-server-6.0.gpg ]; then
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor
fi
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y redis-tools mongodb-org ffmpeg wondershaper
- name: Start Redis
run: sudo systemctl start redis-server
- name: Start MongoDB
run: sudo mongod --dbpath /var/lib/mongodb &
- name: Install Chrome
run: sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
- name: Clone and build Ant Media Server Parent project
run: |
git clone --depth=1 -b ${{ github.ref_name }} https://github.com/ant-media/ant-media-server-parent.git || git clone --depth=1 https://github.com/ant-media/ant-media-server-parent.git
cd ant-media-server-parent
mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true --quiet
cd ..
- name: Build Ant Media Server project
run: mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Dgpg.skip=true --quiet
- name: Clone and build StreamApp project
run: |
git clone --depth=1 -b ${{ github.ref_name }} https://github.com/ant-media/StreamApp.git || git clone --depth=1 https://github.com/ant-media/StreamApp.git
cd StreamApp
npm install
npm run compile
cd embedded-player
npm install
npm run compile
npm run deploy
cd ..
mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V --quiet
cd ..
- name: Clone Web Panel Angular project
run: |
npm install -g @angular/[email protected]
git clone --depth=1 -b ${{ github.ref_name }} https://github.com/ant-media/ManagementConsole_AngularApp.git || git clone --depth=1 https://github.com/ant-media/ManagementConsole_AngularApp.git
cd ManagementConsole_AngularApp
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16.20.2'
cache: 'npm'
- name: Build Web Panel Angular project
run: |
npm install
ng build --prod
cp -a ./dist/. ../src/main/server/webapps/root/
mkdir -p $HOME/.antmedia/cache
rm -rf $HOME/.antmedia/cache/node_modules
cd ..
- name: Replace ffmpeg builds
run: |
wget -O ~/.m2/repository/org/bytedeco/ffmpeg/5.1.2-1.5.8/ffmpeg-5.1.2-1.5.8-linux-x86_64.jar https://storage.sbg.cloud.ovh.net/v1/AUTH_8cb28f9bc6ee43f0a3a1825efbb4311e/test-storage/ffmpeg-5.1.2-1.5.8-linux-x86_64.jar
wget -O ~/.m2/repository/org/bytedeco/ffmpeg/5.1.2-1.5.8/ffmpeg-5.1.2-1.5.8-linux-arm64.jar https://storage.sbg.cloud.ovh.net/v1/AUTH_8cb28f9bc6ee43f0a3a1825efbb4311e/test-storage/ffmpeg-5.1.2-1.5.8-linux-arm64.jar
- name: Package Ant Media Server
run: mvn clean package -U -P assemble -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -DskipTests=true --quiet
- name: Install Ant Media Server
run: |
wget https://raw.githubusercontent.com/ant-media/Scripts/${{ github.ref_name }}/install_ant-media-server.sh -O target/install_ant-media-server.sh || wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh -O target/install_ant-media-server.sh
chmod 755 target/install_ant-media-server.sh
cd target
./install_ant-media-server.sh -i ant-media-server-community*.zip
cd ..
sleep 20
if [[ -f /usr/local/antmedia/log/antmedia-error.log ]]; then
cat /usr/local/antmedia/log/antmedia-error.log
fi
cat /usr/local/antmedia/log/ant-media-server.log
cp src/test/resources/preset-red5-web.properties /usr/local/antmedia/webapps/LiveApp/WEB-INF/red5-web.properties
cp src/test/resources/preset-red5-web.db /usr/local/antmedia/liveapp.db
sed -i 's^server.cpu_limit=.*^server.cpu_limit=100^' /usr/local/antmedia/conf/red5.properties
sed -i 's^server.memory_limit_percentage=.*^server.memory_limit_percentage=100^' /usr/local/antmedia/conf/red5.properties
sudo service antmedia stop
sudo service antmedia start
sleep 10
cat /usr/local/antmedia/log/ant-media-server.log
- name: Run tests and SonarCloud analysis
run: |
export RELEASE_VERSION="$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)"
echo $RELEASE_VERSION
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package org.jacoco:jacoco-maven-plugin:report sonar:sonar -Dmaven.javadoc.skip=true --quiet
mvn org.owasp:dependency-check-maven:check -DfailOnError=false --quiet
- name: Cache Ant Media Server logs on failure
if: failure()
run: |
cat /usr/local/antmedia/log/ant-media-server.log
cat /usr/local/antmedia/log/antmedia-error.log
cat /var/log/mongodb/mongod.log
if [[ -f /usr/local/antmedia/hs_err_pid*.log ]]; then
cat /usr/local/antmedia/hs_err_pid*.log
fi
if [[ -f hs_err_pid*.log ]]; then
cat hs_err_pid*.log
fi
sudo service mongod status
sudo service redis-server status
- name: Deploy snapshots
if: github.ref_type != 'tag'
run: |
echo "Deploy to snapshots"
mvn deploy -P assemble -DskipTests --settings mvn-settings.xml
echo "Deploy to snapshots exited with $?"
- name: Deploy release
if: startsWith(github.ref, 'refs/tags/ams-v')
run: |
echo "Deploy to release"
mvn deploy -P assemble -DskipTests --settings mvn-settings.xml --quiet
echo "Deploy to release exited with $?"