chiark / gitweb /
Merge branch 'revert-af707cd1' into 'master'
[fdroidserver.git] / jenkins-build
index 281aa1d484cc8feb64df1c4441ca95bf3323a8f8..6ddc3edc36ad3a2255075df8aa279c219e523db0 100755 (executable)
@@ -9,80 +9,78 @@ if [ `dirname $0` != "." ]; then
     exit
 fi
 
-set -e
-set -x
-
+# jenkins.debian.net slaves do not export WORKSPACE
 if [ -z $WORKSPACE ]; then
     export WORKSPACE=`pwd`
 fi
 
-if [ -z $ANDROID_HOME ]; then
-    if [ -e ~/.android/bashrc ]; then
-        . ~/.android/bashrc
-    else
-        echo "ANDROID_HOME must be set!"
-        exit
-    fi
-fi
-
-#------------------------------------------------------------------------------#
-# required Java 7 keytool/jarsigner for :file support
-
-export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
-
-#------------------------------------------------------------------------------#
-# run local build
-cd $WORKSPACE/fdroidserver/getsig
-./make.sh
-
-
-#------------------------------------------------------------------------------#
-# run local tests
-cd $WORKSPACE/tests
-./run-tests.sh
-
+set -e
+set -x
 
-#------------------------------------------------------------------------------#
-# test building the source tarball
-cd $WORKSPACE
-python setup.py sdist
+# this is a local repo on the Guardian Project Jenkins server
+cd tests
+#./complete-ci-tests /var/www/fdroid
 
 
-#------------------------------------------------------------------------------#
-# test install using site packages
+# report info about virtualization
+(dmesg | grep -i -e hypervisor -e qemu -e kvm) || true
+(lspci | grep -i -e virtio -e virtualbox -e qemu -e kvm) || true
+lsmod
+if systemd-detect-virt -q ; then
+        echo "Virtualization is used:" `systemd-detect-virt`
+else
+        echo "No virtualization is used."
+fi
+sudo /bin/chmod -R a+rX /var/lib/libvirt/images
+ls -ld /var/lib/libvirt/images
+ls -l /var/lib/libvirt/images || echo no access
+ls -lR ~/.vagrant.d/ || echo no access
+virsh --connect qemu:///system list --all || echo cannot virsh list
+cat /etc/issue
+
+/sbin/ifconfig || true
+hostname || true
+
+# point to the Vagrant/VirtualBox configs created by reproducible_setup_fdroid_build_environment.sh
+# these variables are actually set in fdroidserver/jenkins-build-makebuildserver
+export SETUP_WORKSPACE=$(dirname $WORKSPACE)/reproducible_setup_fdroid_build_environment/fdroidserver
+export XDG_CONFIG_HOME=$SETUP_WORKSPACE
+export VBOX_USER_HOME=$SETUP_WORKSPACE/VirtualBox
+export VAGRANT_HOME=$SETUP_WORKSPACE/vagrant.d
+
+# let's see what is actually there:
+find $SETUP_WORKSPACE | grep -v fdroiddata/metadata/ | cut -b43-9999
+
+# the way we handle jenkins slaves doesn't copy the workspace to the slaves
+# so we need to "manually" clone the git repo hereā€¦
 cd $WORKSPACE
-rm -rf $WORKSPACE/env
-virtualenv --system-site-packages $WORKSPACE/env
-. $WORKSPACE/env/bin/activate
-pip install -e $WORKSPACE
-python setup.py install
-
-# run tests in new pip+virtualenv install
-. $WORKSPACE/env/bin/activate
-fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests.sh
 
+# set up Android SDK to use the Debian packages in stretch
+export ANDROID_HOME=/usr/lib/android-sdk
 
-#------------------------------------------------------------------------------#
-# run pyflakes
-pyflakes fdroid makebuildserver fdroidserver/*.py setup.py
+# ignore username/password prompt for non-existant repos
+git config --global url."https://fakeusername:fakepassword@github.com".insteadOf https://github.com
+git config --global url."https://fakeusername:fakepassword@gitlab.com".insteadOf https://gitlab.com
+git config --global url."https://fakeusername:fakepassword@bitbucket.org".insteadOf https://bitbucket.org
 
+# now build the whole archive
+cd $WORKSPACE
 
-#------------------------------------------------------------------------------#
-# run pylint
+# this can be handled in the jenkins job, or here:
+if [ -e fdroiddata ]; then
+    cd fdroiddata
+    git remote update -p
+    git checkout master
+    git reset --hard origin/master
+    # no don't `git clean` here, it'll wipe the APKs in unsigned/
+else
+    git clone https://gitlab.com/fdroid/fdroiddata.git fdroiddata
+    cd fdroiddata
+fi
 
-cd $WORKSPACE
-set +e
-# disable E1101 until there is a plugin to handle this properly:
-#   Module 'sys' has no '_MEIPASS' member
-# disable F0401 until there is a plugin to handle this properly:
-#   keysync-gui:25: [F] Unable to import 'ordereddict'
-# use the virtualenv python so pylint checks against its installed libs
-python /usr/bin/pylint --output-format=parseable --reports=n \
-    fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable
-
-# to only tell jenkins there was an error if we got ERROR or FATAL, uncomment these:
-[ $(($? & 1)) = "1" ] && echo "FATALs found"
-[ $(($? & 2)) = "2" ] && echo "ERRORs found"
-[ $(($? & 4)) = "4" ] && echo "WARNINGs found"
-set -e
+echo "build_server_always = True" > config.py
+$WORKSPACE/fdroid build --verbose --latest --no-tarball --all
 
+vagrant global-status
+cd builder
+vagrant status