chiark / gitweb /
rename server request from "delete" to "uninstall"
[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     echo "$(date -u) - cleanup in progress..."
15     ps auxww|grep VBox
16     cd $WORKSPACE/buildserver
17     vagrant halt || true
18     sleep 5
19     killall VBoxHeadless || true
20     sleep 5
21     killall -9 VBoxHeadless || true
22     echo "$(date -u) - cleanup done."
23 }
24 trap cleanup_all INT TERM EXIT
25
26 set -e
27 set -x
28
29 # make sure we have the vagrant box image cached
30 test -e ~/.cache/fdroidserver || mkdir -p ~/.cache/fdroidserver
31 cd ~/.cache/fdroidserver
32 wget --tries=1 --timeout=5 --continue https://f-droid.org/jessie64.box || true
33 echo "de3e3c4a9c13e8c015e30edeea0f583b195d1ee8ff9ad4814e933bbfb560200f  jessie64.box" > jessie64.box.sha256
34 sha256sum -c jessie64.box.sha256
35
36 # redirect homes to be in the git repo, so they'll get cleaned and reset
37 export XDG_CONFIG_HOME=$WORKSPACE
38 export VBOX_USER_HOME=$WORKSPACE/VirtualBox
39 mkdir $VBOX_USER_HOME
40 VBoxManage setproperty machinefolder $WORKSPACE/virtualbox.d
41 VBoxManage setproperty logginglevel debug
42 export VAGRANT_HOME=$WORKSPACE/vagrant.d
43 mkdir $VAGRANT_HOME
44
45 cd $WORKSPACE
46 echo "debian_mirror = 'http://ftp.uk.debian.org/debian/'" > $WORKSPACE/makebuildserver.config.py
47 echo "boot_timeout = 1200" >> $WORKSPACE/makebuildserver.config.py
48 echo "apt_package_cache = True" >> $WORKSPACE/makebuildserver.config.py
49 ./makebuildserver --verbose
50
51 # this can be handled in the jenkins job, or here:
52 if [ -e fdroiddata ]; then
53     cd fdroiddata
54     git checkout master
55     git pull
56     cd ..
57 else
58     git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git fdroiddata
59 fi
60
61 cd fdroiddata
62 echo "build_server_always = True" > config.py
63 # if it can't build fdroid, then its really broken
64 ../fdroid build --verbose --stop --latest org.fdroid.fdroid
65 # Gradle, JNI, preassemble
66 ../fdroid build --stop org.adaway:55
67 # Maven
68 #../fdroid build --stop org.quantumbadger.redreader:55
69 # Custom build (make)
70 #../fdroid build --stop com.amaze.filemanager:29
71 # Uses verification
72 #../fdroid build --stop info.guardianproject.checkey:101
73 # Gradle with retrolambda (JDK7 and JDK8)
74 #../fdroid build --stop com.moez.QKSMS:124