forked from duplicati/duplicati
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·53 lines (42 loc) · 1.37 KB
/
build.sh
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
#!/bin/bash
quit_on_error() {
echo "Error on line $1, stopping build."
exit 1
}
list_dir() {
echo "listing directory $1 :"
ls -al $1
}
trap 'quit_on_error $LINENO' ERR
CATEGORY=$1
TRAVIS_BUILD_DIR=${2:-.}
if id travis &> /dev/null
then
TESTUSER=travis
else
TESTUSER=$(whoami)
fi
echo "Build script starting with parameters TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR and CATEGORY=$CATEGORY"
# build duplicati
list_dir "${TRAVIS_BUILD_DIR}"/packages/
echo "travis_fold:start:build_duplicati"
msbuild /p:Configuration=Release Duplicati.sln
cp -r ./Duplicati/Server/webroot ./Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release/webroot
echo "travis_fold:end:build_duplicati"
rm -rf ~/duplicati_testdata && mkdir ~/duplicati_testdata
chown -R $TESTUSER ~/duplicati_testdata/
chmod -R 755 ~/duplicati_testdata
# run unit tests
echo "travis_fold:start:unit_test"
if [[ "$CATEGORY" != "GUI" && "$CATEGORY" != "" ]]; then
mono ./testrunner/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe \
./Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll --where:cat==$CATEGORY --workers=1
fi
echo "travis_fold:end:unit_test"
# start server and run gui tests
echo "travis_fold:start:gui_unit_test"
if [[ "$CATEGORY" == "GUI" ]]; then
mono ./Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release/Duplicati.Server.exe &
python guiTests/guiTest.py
fi
echo "travis_fold:end:gui_unit_test"