forked from ant-media/Ant-Media-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
155 lines (134 loc) · 6.17 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
dist: focal
language: java
jdk:
- openjdk11
node_js: "14.8.0"
git:
depth: false
# Sonar cloud addons on travis has some issues so that it's used directly
addons:
sonarcloud:
organization: "ant-media"
token: $SONAR_TOKEN
before_install:
- 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*
- sudo apt autoremove
- sudo rm -rf /var/lib/mongodb # remove old mongodb files
#- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
- wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
- echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
- sudo apt-get update -qq
#install mongodb ffmpeg wondershaper
- sudo apt-get install mongodb-org ffmpeg wondershaper -y
- sudo mongod --dbpath /var/lib/mongodb &>/dev/null & # start mongo db - don' write log
- 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
#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;
- mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V --quiet;
- cd ..;
# get Angular app
- npm install -g @angular/cli@10.0.5
- (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
- npm install
- ng build --prod
- cp -a ./dist/. ../src/main/server/webapps/root/
- cd ..
# 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 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 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 --quiet
#depedency vulnerability check
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
after_failure:
- sudo cat /usr/local/antmedia/log/ant-media-server.log
- sudo service mongod status
- 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
deploy:
- provider: script
script: "mvn deploy -P assemble -DskipTests --settings mvn-settings.xml --quiet"
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: "mvn deploy -P assemble -DskipTests --settings mvn-settings.xml --quiet"
cleanup: true
on:
#deploy to maven if it is a release tagged
tags: true
condition: $TRAVIS_TAG =~ ^ams-v