-
Notifications
You must be signed in to change notification settings - Fork 637
/
.travis.yml
211 lines (184 loc) · 8.79 KB
/
.travis.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
dist: jammy
language: java
jdk:
- openjdk17
git:
depth: false
# PAY ATTENTION:
# We use a custom ffmpeg build to support current OS versions.
# We just had a workaround solution. I mean we don't republish the ffmpeg with a new group id
# We just build ffmpeg with the proper configurations and downloads from OVH storage and replaces it in the local repository below
# Test codes are checking the proper configuraitons such as cuda and disabling crystalhd decoders
#
# For more information visit the build_update_ffmpeg.md doc in enterprise project
#~/.m2/repository/org/bytedeco/ffmpeg/5.1.2-1.5.8/ffmpeg-5.1.2-1.5.8-linux-x86_64.jar
#~/.m2/repository/org/bytedeco/ffmpeg/5.1.2-1.5.8/ffmpeg-5.1.2-1.5.8-linux-arm64.jar
# Sonar cloud addons on travis has some issues so that it's used directly
addons:
sonarcloud:
organization: "ant-media"
token: $SONAR_TOKEN
apt:
packages:
- redis-tools
services:
- redis-server
before_install:
- nvm install 16.20.2
- nvm use 16.20.2
- openssl aes-256-cbc -K $encrypted_5fef4fa28306_key -iv $encrypted_5fef4fa28306_iv -in codesigning.asc.enc -out codesigning.asc -d
- export GPG_TTY=$(tty) #-> https://github.com/keybase/keybase-issues/issues/2798
- gpg2 --batch --fast-import codesigning.asc
- sudo apt purge mongodb* -qq
- sudo apt autoremove -qq
- sudo rm -rf /var/lib/mongodb # remove old mongodb files
#- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
- curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor
- 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
- sudo sed -e 's/^bind.*/bind 127.0.0.1/' /etc/redis/redis.conf > redis.conf
- sudo mv redis.conf /etc/redis
- sudo service redis-server start
- sudo apt-get update -qq
#install mongodb ffmpeg wondershaper
- sudo apt-get install mongodb-org ffmpeg wondershaper -y -qq
- sudo mongod --dbpath /var/lib/mongodb &>/dev/null & # start mongo db - don' write log
#install chrome
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo apt install ./google-chrome-stable_current_amd64.deb -y
- sudo git clone --depth=1 https://github.com/ant-media/utilities.git /usr/local/onvif
# get parent project
- (if [ $(git ls-remote https://github.com/ant-media/ant-media-server-parent.git $TRAVIS_BRANCH | wc -l) == "1" ];
then
echo " $TRAVIS_BRANCH branch found";
git clone --depth=1 -b $TRAVIS_BRANCH https://github.com/ant-media/ant-media-server-parent.git;
else
echo "branch not found";
git clone --depth=1 https://github.com/ant-media/ant-media-server-parent.git;
fi)
- cd ant-media-server-parent
- mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true --quiet
- cd ..
# install Ant Media Server
- mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Dgpg.skip=true --quiet
#get StreamApp project
- (if [ $(git ls-remote https://github.com/ant-media/StreamApp.git $TRAVIS_BRANCH | wc -l) == "1" ];
then
echo " $TRAVIS_BRANCH branch found";
git clone --depth=1 -b $TRAVIS_BRANCH https://github.com/ant-media/StreamApp.git;
else
echo "branch not found. Checking out master";
git clone --depth=1 https://github.com/ant-media/StreamApp.git;
fi)
- 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 ..;
# get Angular app
- npm install -g @angular/[email protected]
- (if [ $(git ls-remote https://github.com/ant-media/ManagementConsole_AngularApp.git $TRAVIS_BRANCH | wc -l) == "1" ];
then
echo " $TRAVIS_BRANCH branch found";
git clone --depth=1 -b $TRAVIS_BRANCH https://github.com/ant-media/ManagementConsole_AngularApp.git;
else
echo "branch not found";
git clone --depth=1 https://github.com/ant-media/ManagementConsole_AngularApp.git;
fi)
- cd ManagementConsole_AngularApp
#If there is something in the cache, get it
- (if [[ -d "$HOME/.antmedia/cache/node_modules" ]]; then
echo "Restore node_modules from cache";
cp -rf "$HOME/.antmedia/cache/node_modules" .;
fi)
- npm install
- ng build --prod
- cp -a ./dist/. ../src/main/server/webapps/root/
#update the cache directory
- mkdir -p $HOME/.antmedia/cache # create if not exist
- rm -rf $HOME/.antmedia/cache/node_modules
- mv node_modules $HOME/.antmedia/cache/
- cd ..
#before package replace the ffmpeg linux-86_64 and arm64 build with custom build
- 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
# package ant media server
- mvn clean package -U -P assemble -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -DskipTests=true --quiet
#get install script
- (if [ $(git ls-remote https://github.com/ant-media/Scripts.git $TRAVIS_BRANCH | wc -l) == "1" ];
then
echo " $TRAVIS_BRANCH branch found";
wget https://raw.githubusercontent.com/ant-media/Scripts/$TRAVIS_BRANCH/install_ant-media-server.sh -O target/install_ant-media-server.sh;
else
echo "branch not found";
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh -O target/install_ant-media-server.sh;
fi)
- chmod 755 target/install_ant-media-server.sh
- cd target
- ./install_ant-media-server.sh -i ant-media-server-community*.zip
- cd ..
- echo "Waiting a little to make sure server is started "
- sleep 20
- (if [[ -f /usr/local/antmedia/log/antmedia-error.log ]];
then
sudo cat /usr/local/antmedia/log/antmedia-error.log;
fi)
- sudo cat /usr/local/antmedia/log/ant-media-server.log
- sudo cp src/test/resources/preset-red5-web.properties /usr/local/antmedia/webapps/LiveApp/WEB-INF/red5-web.properties
- sudo cp src/test/resources/preset-red5-web.db /usr/local/antmedia/liveapp.db
- sudo sed -i 's^server.cpu_limit=.*^server.cpu_limit=100^' /usr/local/antmedia/conf/red5.properties
- sudo 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
- sudo cat /usr/local/antmedia/log/ant-media-server.log
install:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V --quiet
before_script:
- sudo chmod -R 777 /tmp
script:
- 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
# option to add above (-Dtest="MuxerUnitTest") for running custom tests
- mvn org.owasp:dependency-check-maven:check -DfailOnError=false --quiet
#depedency vulnerability check
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/.antmedia/cache'
after_failure:
- sudo cat /usr/local/antmedia/log/ant-media-server.log
- sudo cat /usr/local/antmedia/log/antmedia-error.log
- sudo cat /var/log/mongodb/mongod.log
- sudo cat /usr/local/antmedia/hs_err_pid*.log # cat hs_err_pid file if it exists
- sudo cat hs_err_pid*.log # cat hs_err_pid file if it exists
- sudo service mongod status
- sudo service redis-server status
deploy:
- provider: script
script: |
echo "Deploy to snapshots"
mvn deploy -P assemble -DskipTests --settings mvn-settings.xml
echo "Deploy to snapshots exited with $?"
skip_cleanup: true
on:
tags: false
all_branches: true
#deploy all branches to mvn if it is a snapshot version
condition: $(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec) = *"SNAPSHOT"*
- provider: script
script: |
echo "Deploy to release"
mvn deploy -P assemble -DskipTests --settings mvn-settings.xml --quiet
echo "Deploy to release exited with $?"
skip_cleanup: true
on:
#deploy to maven if it is a release tagged
tags: true
condition: $TRAVIS_TAG =~ ^ams-v