3 if [ `dirname $0` != "." ]; then
4 echo "only run this script like ./`basename $0`"
8 if [ -z $WORKSPACE ]; then
12 # make sure that no VirtualBox processes are left running
15 echo "$(date -u) - cleanup in progress..."
16 ps auxww | grep -e VBox -e qemu
17 virsh --connect qemu:///system list --all
18 ls -hl /var/lib/libvirt/images
19 cd $WORKSPACE/buildserver
24 killall -9 VBoxHeadless
25 echo "$(date -u) - cleanup done."
27 trap cleanup_all INT TERM EXIT
32 # make sure we have the vagrant box image cached
33 test -e ~/.cache/fdroidserver || mkdir -p ~/.cache/fdroidserver
34 cd ~/.cache/fdroidserver
35 wget --tries=1 --timeout=5 --continue https://f-droid.org/jessie64.box || true
36 echo "de3e3c4a9c13e8c015e30edeea0f583b195d1ee8ff9ad4814e933bbfb560200f jessie64.box" > jessie64.box.sha256
37 sha256sum -c jessie64.box.sha256
39 # redirect homes to be in the git repo, so they'll get cleaned and reset
40 export XDG_CONFIG_HOME=$WORKSPACE
41 export VBOX_USER_HOME=$WORKSPACE/VirtualBox
43 if which VBoxManage; then
44 VBoxManage setproperty machinefolder $WORKSPACE/virtualbox.d
45 VBoxManage setproperty logginglevel debug
47 export VAGRANT_HOME=$WORKSPACE/vagrant.d
51 echo "debian_mirror = 'https://deb.debian.org/debian/'" > $WORKSPACE/makebuildserver.config.py
52 echo "boot_timeout = 1200" >> $WORKSPACE/makebuildserver.config.py
53 echo "apt_package_cache = True" >> $WORKSPACE/makebuildserver.config.py
54 echo "copy_caches_from_host = True" >> $WORKSPACE/makebuildserver.config.py
55 ./makebuildserver --verbose --clean
57 if [ -z "`vagrant box list | egrep '^buildserver\s+\((libvirt|virtualbox), [0-9]+\)$'`" ]; then
59 echo "ERROR: buildserver box does not exist!"
63 # this can be handled in the jenkins job, or here:
64 if [ -e fdroiddata ]; then
66 while ! git fetch; do sleep 1; done
69 git reset --hard origin/master
72 git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git fdroiddata
77 if [ -z $ANDROID_HOME ]; then
78 if [ -e ~/.android/bashrc ]; then
81 echo "ANDROID_HOME must be set!"
86 ../fdroid init --verbose
87 export GNUPGHOME=$WORKSPACE/tests/gnupghome
88 echo "gpghome = '$GNUPGHOME'" >> config.py
89 echo "gpgkey = 'CE71F7FB'" >> config.py
90 echo "build_server_always = True" >> config.py
92 # if it can't build fdroid, then its really broken
93 ../fdroid build --verbose --stop --latest org.fdroid.fdroid
94 # Gradle, JNI, preassemble
95 ../fdroid build --verbose --stop org.adaway:55
97 ../fdroid build --verbose --stop info.guardianproject.checkey:101
98 # building old versions should still work
99 ../fdroid build --verbose --stop org.fdroid.fdroid:96150
100 # test OTA update ZIP build and publish
101 ../fdroid build --verbose --stop org.fdroid.fdroid.privileged.ota:2030
103 # publish process when building and signing are on separate machines
104 test -d repo || mkdir repo
105 test -d archive || mkdir archive
106 ../fdroid publish --verbose
107 ../fdroid gpgsign --verbose
108 ../fdroid update --verbose --nosign
109 ../fdroid signindex --verbose
111 ../fdroid rewritemeta --verbose