forked from ant-media/Ant-Media-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
96 lines (81 loc) · 4.02 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
language: java
jdk:
- openjdk8
sudo: required
addons:
sonarcloud:
organization: "ant-media"
token:
secure: $SONAR_TOKEN
#travis running on ubuntu 14.04
before_install:
- openssl aes-256-cbc -K $encrypted_5fef4fa28306_key -iv $encrypted_5fef4fa28306_iv -in codesigning.asc.enc -out codesigning.asc -d
- gpg --fast-import codesigning.asc
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
- echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
- sudo add-apt-repository ppa:mc3man/trusty-media -y # this for ffmpeg
- sudo apt-get update -qq
- sudo apt-get install -y mongodb-org #install mongodb
- sudo apt-get install ffmpeg -qq # start ffmpeg
- sudo service mongod start # start mongo db
- sudo apt-get install wondershaper
- sudo git clone --depth=1 https://github.com/ant-media/utilities.git /usr/local/onvif
- (if [ $(git ls-remote https://github.com/ant-media/Ant-Media-Server-Common.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-Common.git; else echo "branch not found"; git clone --depth=1 -b dev https://github.com/ant-media/Ant-Media-Server-Common.git; fi)
- cd Ant-Media-Server-Common
- mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true --quiet
- cd ..
- git clone --depth=1 https://github.com/ant-media/red5-plugins.git && cd red5-plugins/tomcat/ && mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true --quiet && cd ../..
- mvn clean package -U -P assemble -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -DskipTests=true --quiet
- wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh -O target/install_ant-media-server.sh # install script
- 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
- 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 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
script:
- echo $(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dmaven.javadoc.skip=true
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
after_failure:
- sudo cat /usr/local/antmedia/log/ant-media-server.log
deploy:
- provider: script
script: "mvn deploy -P assemble -DskipTests --quiet --settings mvn-settings.xml"
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: "mvn deploy -P assemble -DskipTests --quiet --settings mvn-settings.xml"
skip_cleanup: true
on:
#deploy to maven if it is master branch and tagged
tags: true
branch: master
- provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: "target/ant-media-server-community*.zip"
skip_cleanup: true
name: "Ant Media Server Community $(date +'%F-%T')"
prerelease: true
on:
#deploy to github if it is master branch and tagged
tags: true
branch: master
#above configuration prevents deploying a new release(not snapshot) if it is not tagged