# make sure that no VirtualBox processes are left running
cleanup_all() {
+ set +e
echo "$(date -u) - cleanup in progress..."
- ps auxww|grep VBox
+ ps auxww | grep -e VBox -e qemu
+ virsh --connect qemu:///system list --all
+ ls -hl /var/lib/libvirt/images
cd $WORKSPACE/buildserver
- vagrant halt || true
+ vagrant halt
sleep 5
- killall VBoxHeadless || true
+ killall VBoxHeadless
sleep 5
- killall -9 VBoxHeadless || true
+ killall -9 VBoxHeadless
echo "$(date -u) - cleanup done."
}
trap cleanup_all INT TERM EXIT
# make sure we have the vagrant box image cached
test -e ~/.cache/fdroidserver || mkdir -p ~/.cache/fdroidserver
cd ~/.cache/fdroidserver
-wget --tries=1 --timeout=5 --continue https://f-droid.org/jessie32.box || true
-echo "ff6b0c0bebcb742783becbc51a9dfff5a2a0a839bfcbfd0288dcd3113f33e533 jessie32.box" > jessie32.box.sha256
-sha256sum -c jessie32.box.sha256
+wget --tries=1 --timeout=5 --continue https://f-droid.org/jessie64.box || true
+echo "de3e3c4a9c13e8c015e30edeea0f583b195d1ee8ff9ad4814e933bbfb560200f jessie64.box" > jessie64.box.sha256
+sha256sum -c jessie64.box.sha256
# redirect homes to be in the git repo, so they'll get cleaned and reset
export XDG_CONFIG_HOME=$WORKSPACE
export VBOX_USER_HOME=$WORKSPACE/VirtualBox
mkdir $VBOX_USER_HOME
-VBoxManage setproperty machinefolder $WORKSPACE/virtualbox.d
-VBoxManage setproperty logginglevel debug
+if which VBoxManage; then
+ VBoxManage setproperty machinefolder $WORKSPACE/virtualbox.d
+ VBoxManage setproperty logginglevel debug
+fi
export VAGRANT_HOME=$WORKSPACE/vagrant.d
mkdir $VAGRANT_HOME
cd $WORKSPACE
-echo "debian_mirror = 'http://ftp.uk.debian.org/debian/'" > $WORKSPACE/makebuildserver.config.py
+echo "debian_mirror = 'https://deb.debian.org/debian/'" > $WORKSPACE/makebuildserver.config.py
echo "boot_timeout = 1200" >> $WORKSPACE/makebuildserver.config.py
echo "apt_package_cache = True" >> $WORKSPACE/makebuildserver.config.py
-./makebuildserver
+echo "copy_caches_from_host = True" >> $WORKSPACE/makebuildserver.config.py
+./makebuildserver -vv --clean
+
+if [ -z "`vagrant box list | egrep '^buildserver\s+\((libvirt|virtualbox), [0-9]+\)$'`" ]; then
+ vagrant box list
+ echo "ERROR: buildserver box does not exist!"
+ exit 1
+fi
# this can be handled in the jenkins job, or here:
if [ -e fdroiddata ]; then
cd fdroiddata
+ while ! git fetch; do sleep 1; done
+ git remote update -p
git checkout master
- git pull
+ git reset --hard origin/master
+ git clean -fdx
cd ..
else
git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git fdroiddata
fi
cd fdroiddata
-echo "build_server_always = True" > config.py
+
+if [ -z $ANDROID_HOME ]; then
+ if [ -e ~/.android/bashrc ]; then
+ . ~/.android/bashrc
+ else
+ echo "ANDROID_HOME must be set!"
+ exit 1
+ fi
+fi
+
+../fdroid init --verbose
+export GNUPGHOME=$WORKSPACE/tests/gnupghome
+echo "gpghome = '$GNUPGHOME'" >> config.py
+echo "gpgkey = 'CE71F7FB'" >> config.py
+echo "build_server_always = True" >> config.py
+
+# if it can't build fdroid, then its really broken
+../fdroid build --verbose --stop --latest org.fdroid.fdroid
# Gradle, JNI, preassemble
-../fdroid build org.adaway:55
-# Maven
-../fdroid build org.quantumbadger.redreader:55
-# Ant, submodules and custom prebuild/build
-../fdroid build app.openconnect:959
-# Custom build (make)
-../fdroid build org.xcsoar:101
-# Uses verification
-../fdroid build info.guardianproject.checkey:101
-# Gradle with retrolambda (JDK7 and JDK8)
-../fdroid build com.moez.QKSMS:124
+../fdroid build --verbose --stop org.adaway:55
+# building old versions should still work
+../fdroid build --verbose --stop org.fdroid.fdroid:96150
+# test OTA update ZIP build and publish
+../fdroid build --verbose --stop org.fdroid.fdroid.privileged.ota:2070
+
+# publish process when building and signing are on separate machines
+test -d repo || mkdir repo
+test -d archive || mkdir archive
+# copy everything over to run on SIGN machine
+../fdroid publish --verbose
+../fdroid gpgsign --verbose
+# copy everything over to run on BUILD machine
+../fdroid update --verbose --nosign
+# copy everything over to run on SIGN machine
+../fdroid signindex --verbose
+
+../fdroid rewritemeta --verbose
+git --no-pager diff