Merge branch 'master' into increase-upload-max-limit #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: upgrade.sh Validation Test | |
on: [push] | |
jobs: | |
install_and_upgrade_ant_media_server: | |
runs-on: ubuntu-latest | |
name: Install Previous Version of Ant Media Server | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install Ant Media Server | |
run: | | |
curl --progress-bar -o ams_community.zip -L "$(curl -s -H "Accept: application/vnd.github+json" https://api.github.com/repos/ant-media/Ant-Media-Server/releases | jq -r '.[1].assets[0].browser_download_url')" | |
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh | |
sudo bash ./install_ant-media-server.sh -i ams_community.zip | |
sleep 30 | |
PREVIOUS_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') | |
echo "Previous Version: $PREVIOUS_VERSION" | |
wget https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/upgrade.sh | |
DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh | |
sleep 20 | |
wget http://localhost:5080 -O index.html | |
CURRENT_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') | |
(if [ "$(printf "%s\n" "$PREVIOUS_VERSION" "$CURRENT_VERSION" | sort -V | tail -n 1)" = "$PREVIOUS_VERSION" ]; | |
then | |
echo "It's not upgraded to the latest release.PREVIOUS_VERSION-> $PREVIOUS_VERSION and CURRENT_VERSION-> $CURRENT_VERSION "; | |
exit 1; | |
elif [ "$VERSION_PREVIOUS_THAN_LATEST_RELEASE" != "$CURRENT_VERSION" ]; then | |
echo "Version upgraded to the latest release -> from PREVIOUS_VERSION-> $PREVIOUS_VERSION to CURRENT_VERSION->$CURRENT_VERSION "; | |
fi) | |