chiark / gitweb /
jenkins-build-makebuildserver: include VLC as a test build
[fdroidserver.git] / jenkins-build-makebuildserver
1 #!/bin/bash
2
3 if [ `dirname $0` != "." ]; then
4     echo "only run this script like ./`basename $0`"
5     exit
6 fi
7
8 if [ -z $WORKSPACE ]; then
9     WORKSPACE=`pwd`
10 fi
11
12 # make sure that no VirtualBox processes are left running
13 cleanup_all() {
14     set +e
15     echo "$(date -u) - cleanup in progress..."
16     ps auxww | grep -e VBox -e qemu
17     cd $WORKSPACE/buildserver
18     vagrant halt
19     sleep 5
20     killall VBoxHeadless
21     sleep 5
22     killall -9 VBoxHeadless
23     echo "$(date -u) - cleanup done."
24 }
25 trap cleanup_all INT TERM EXIT
26
27 set -e
28 set -x
29
30 # make sure we have the vagrant box image cached
31 test -e ~/.cache/fdroidserver || mkdir -p ~/.cache/fdroidserver
32 cd ~/.cache/fdroidserver
33 wget --tries=1 --timeout=5 --continue https://f-droid.org/jessie64.box || true
34 echo "de3e3c4a9c13e8c015e30edeea0f583b195d1ee8ff9ad4814e933bbfb560200f  jessie64.box" > jessie64.box.sha256
35 sha256sum -c jessie64.box.sha256
36
37 # redirect homes to be in the git repo, so they'll get cleaned and reset
38 export XDG_CONFIG_HOME=$WORKSPACE
39 export VBOX_USER_HOME=$WORKSPACE/VirtualBox
40 mkdir $VBOX_USER_HOME
41 if which VBoxManage; then
42     VBoxManage setproperty machinefolder $WORKSPACE/virtualbox.d
43     VBoxManage setproperty logginglevel debug
44 fi
45 export VAGRANT_HOME=$WORKSPACE/vagrant.d
46 mkdir $VAGRANT_HOME
47
48 cd $WORKSPACE
49 echo "debian_mirror = 'http://ftp.uk.debian.org/debian/'" > $WORKSPACE/makebuildserver.config.py
50 echo "boot_timeout = 1200" >> $WORKSPACE/makebuildserver.config.py
51 echo "apt_package_cache = True" >> $WORKSPACE/makebuildserver.config.py
52 ./makebuildserver --verbose --clean
53
54 # this can be handled in the jenkins job, or here:
55 if [ -e fdroiddata ]; then
56     cd fdroiddata
57     git checkout master
58     git pull
59     cd ..
60 else
61     git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git fdroiddata
62 fi
63
64 cd fdroiddata
65 echo "build_server_always = True" > config.py
66 # if it can't build fdroid, then its really broken
67 ../fdroid build --verbose --stop --latest org.fdroid.fdroid
68 # Gradle, JNI, preassemble
69 ../fdroid build --verbose --stop org.adaway:55
70 # Uses verification
71 ../fdroid build --verbose --stop info.guardianproject.checkey:101
72 # building old versions should still work
73 ../fdroid build --verbose --stop org.fdroid.fdroid:96150
74 # VLC is important, and uses cmake
75 ../fdroid build --verbose --stop org.videolan.vlc:12000604